Book a Demo

Author Topic: New C# Add-in Example Released  (Read 5706 times)

TomO

  • EA Administrator
  • EA User
  • *****
  • Posts: 80
  • Karma: +7/-0
  • EA - Bridging the gap between Business and IT
    • View Profile
    • Sparx Systems
New C# Add-in Example Released
« on: August 31, 2005, 07:21:06 pm »
Hi Guys,
Due to the increasing amount of questions regarding the automation interface and its basic functions, I have written another basic example. This one is a C#.Net dll as opposed to a stand alone application (like the last). It explains how to setup VS2003 for debugging and running, also gives you the basic code for connection and menu manipulation; right down to how to setup the registry. If anyone is looking to have a play with EA's automation interface, but doesn't know where to begin I suggest taking a look.
C# How to create a Basic Add-In
http://sparxsystems.com.au/resources/developers/autint.html

Best Regards
Tom O
« Last Edit: August 31, 2005, 07:42:43 pm by TomO »

vanWeyden

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • Life is to short for other than realtime
    • View Profile
Re: New C# Add-in Example Released
« Reply #1 on: November 14, 2005, 02:11:29 pm »
I've built the C# CS_AddinFramework sample DLL (using C# Express for now). EA comes up when I run it, but I don't get a new entry in the EA/Tools menu - not even after doing a Tools/Customize/Menu/Reset.

I think I followed the instructions in the Readme:
-adding Interop.EA.dll to COM references,
reference path, register for COM Interop setting, 'Class library' type (as needed).  I didn't change start application path (didn't see the option) but EA does start so I think it is set.
- setting new registry key [HKEY_CURRENT_USER\Software\Sparx Systems\EA\Addins\CS_AddinFramework]
@="CS_AddinFramework.Main"  where @ is for the '(Default)' name value shown for the key

I also tried copying the DLL to the Sparx Systems\EA directory, and running regasm on it. (This wasn't in the Readme, but was suggested elsewhere) But still no luck.

Hope you can help

thomaskilian

  • Guest
Re: New C# Add-in Example Released
« Reply #2 on: November 15, 2005, 03:32:11 am »
Check that your DLL has been registered correctly. That is: try instancing an object and call EA_Connect.

vanWeyden

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • Life is to short for other than realtime
    • View Profile
Re: New C# Add-in Example Released
« Reply #3 on: November 15, 2005, 05:15:18 pm »
Looks like my problem was I was assuming in regedit that the Registry  Addins key  was

 <...>/Sparx Systems/EA400/EA/Addins

since that existed already.  

After creating <...>/Sparx Systems/EAddins instead, and added my new key to that my Addin now shows up.

The Sparx README file(s) that came with the sample code both said to 'find' the EAAddins key, so maybe my mistake was somewhat understandable, since the key wasn't there at first.

Thanks.

vanWeyden

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • Life is to short for other than realtime
    • View Profile
Re: New C# Add-in Example Released
« Reply #4 on: November 15, 2005, 06:21:40 pm »
Sigh, now it is not working again. I was in & out of C# and regedit etc and guess something got fouled up somewhere again...  But it was working for a while (new Addin top-level, with my Addin in the list).  Not sure what happened...

thomaskilian

  • Guest
Re: New C# Add-in Example Released
« Reply #5 on: November 16, 2005, 02:23:25 am »
Funny, I also had trouble with my Add-In. It worked - not- yes - not - again. Seems to be stable now. Maybe you should shake it a bit more ???