Book a Demo

Author Topic: Add in not properly integrated  (Read 4730 times)

Thomas_Arnbjerg

  • EA User
  • **
  • Posts: 80
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Add in not properly integrated
« on: August 18, 2008, 09:38:47 pm »
Hi all.

I'm trying to make my own add-in to Enterprise Architect. I've downloaded the template project CS_AddinFramework and compiled it.

When I launch EA in a debugging session I can see the add-in under the add-in manager ('Enabled') , but no menu items appear. The method 'EA_GetMenuItems' is never hit in the debugger. The strange thing is that EA_Disconnect IS hit.

Any ideas?

- I'm using VS2003 SP1
- I've made a configuration file for EA to specify the use of .Net framework 1.1 (the newest supported by VS2003 and a prerequisite for being able to debug)
- OLE/Com viewer displays CS_AddinFramework.Main as a published interface.

Thank's

Thomas :o

Thomas_Arnbjerg

  • EA User
  • **
  • Posts: 80
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Add in not properly integrated
« Reply #1 on: August 19, 2008, 06:57:13 pm »
A small update...

Debugging reveals that the constructor of class Main IS hit so the COM interop, registry settings etc. seem to work.

EA_GetMenuItems still isn't hit.

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Add in not properly integrated
« Reply #2 on: August 19, 2008, 07:50:34 pm »
What about EA_Connect?

Maybe some Exception occurs in the constructor or in EA_Connect. Or EA suffers some Exception when calling the constructor or EA_Connect and handles it by not calling the methods it would normally call next.

One reason could be that your AddIn references an obsolete EA interface and a type mismatch COM error occurs in EA when it calls your constructor.

Thomas_Arnbjerg

  • EA User
  • **
  • Posts: 80
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Add in not properly integrated
« Reply #3 on: August 19, 2008, 08:28:35 pm »
Thanks for the input..

A breakpoint in EA_Connect also isn't hit.

No exception is reported in the constructor.

If it wasn't for the fact that EA_Disconnect is called successfully I would think it was a registry/COM problem.

It's almost as if the method signature is invalid...

(public String EA_Connect(EA.Repository Repository))

Is there a way of checking if the EA COM types are properly registered (they appear to be properly registered as seen in the tool OLE/COM viewer)?

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Add in not properly integrated
« Reply #4 on: August 19, 2008, 08:39:27 pm »
Quote
It's almost as if the method signature is invalid...

So it seems. The constructor and EA_Disconnect are parameterless, so they're not concerned. For the others, the signature could be invalid if you're referencing another version of the EA COM API than your current EA version uses.

Here's what I would try: Remove the reference to EA from your AddIn project and add it again by selecting "Enterprise Architect Object Model x.xx" from the COM tab in Visual Studios "Add Reference" dialog.
« Last Edit: August 19, 2008, 08:40:02 pm by Frank_Horn »

Thomas_Arnbjerg

  • EA User
  • **
  • Posts: 80
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Add in not properly integrated
« Reply #5 on: August 19, 2008, 09:24:40 pm »
Tried refreshing the reference without success.


- but your suggestion triggered some new experiments

... AND the solution is to rename the interop.ea.dll installed in the EA folder. Apparently this interop dll is incompatible with my add-in but is loaded instead of the interop dll created by VS2003 (in the <project>\obj folder).

So now everything works.  ;D

Thank's a lot for your assistance!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Add in not properly integrated
« Reply #6 on: August 19, 2008, 10:20:44 pm »
So VS2003 it is. There were a couple of threads a while ago about similar problems, and a satisfying answer was never found.

I think you've found it now.  Looks like EA setup registers interop.ea.dll as the default interop assembly for their COM type library, and you have to delete or rename it to make your .Net 1.1 based AddIn use the interop assembly which VS2003 has created.