Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: BioformLivesAgain on March 10, 2008, 05:22:42 am
-
Could anyone point me to getting a "Hello-World" project/environment setup for an EA Add-In... the online help files don't seem to tell me enough, or I am too in-experienced...
Thanks,
David
-
Hi (other) David,
Step one: Don't Panic! [With thanks to Douglas Adams for teaching us all that.]
This is not too difficult to do, but rather difficult to explain. So please help me out a bit.
How far have you gotten? Have you set up your project? Your references? Can you see anything from EA in your code?
David
-
Hey Midnight!
Took me awhile to find my towel!
This is what I have done so far...
1.) I grabbed the zipfile from the website for the "CS_AddinFramework" example (it's in C#, but I figured if I could get this working, I could figure it out for VB) and extracted it... converted it to 2005 using the VS wizard and compiled it with no problems...
2.) Added the Reg key value for the Add-In "CS_AddinFramework.Main"
3.) Configured VS 2005 (Express) using the notes for VS2003...
Started debugging (F5) after setting a breakpoint in the main class...
4.) EA loads.... displays menus... but the add-in does not start running in the debug window...
IF I open the add-in manager the add-in is listed, but the status entry says ''Error-Missing"...
So SOME success, but not a lot!
Other, Other David
-
David,
You're almost there.
1. you've created a dll -> OK
2. you told EA to load that dll as an addin (via de regkey)
3. EA tries to load the dll, and asks Windows where it is. At this point Windows does not know yet. What you have to do is register the dll in Windows using regsvr32
-
Sounds like you've done all the right things, except to register the dll, as Geert says.
If you still have problems on the debug side, check that execution was not prevented by XP or (more likely) Vista. This is not too likely to happen, as debug sessions usually work.
Let us know!
David
-
Thanks for the help... but I can't seem to get the DLL to register successfully?
First I was getting an error when my registration path to the DLL contained an embedded space (C:\Documents and Settings\...) I moved the project to another directory without embedded spaces and rebuilt.
Then regsvr ...pathname\{DLLName}.dll and then got this error message:
...dll was loaded, but the DLLRegisterServer entry point was not found. This file can not be registered....
I am using XP btw,
Gonna take a break and read some Vogan poetry to get over this lack of nausea...
OtherDavid
-
From memory, .NET DLL's get registered with regasm.exe, not regsvr32.exe. In either case, you shouldn't need to manually run this to do debugging. In your VS project, make sure that "Register for COM Interop" is enabled (I think this is usually under the Build options).
-
Thanks Aaron,
If I actually had a memory, this might have jogged it.
The obvious - meaning 'usually overlooked by Midnight' - step is to make sure you set your project to be visible to COM. You generally do this when you create the project, by choosing an appropriate project template. You can also open the Assembly Information dialog from My Project Application page and check the option at the very bottom of the dialog.
Now the rest starts to work, just as Aaron says.
David
PS: Make sure that Visual Studio knows you want to debug with EA. In VS, open the My Project Debug page. You'll see an option called Start Action. Choose the middle option, Start external program. Set this to point to EA. After all, your add-in won't be much use without EA running, will it?
-
One point, you mention "configured VS 2005 (Express)" did you mean the Express edition of VS 2005?
If so, it doesn't support add-ins by design.
Regards
Paul
-
Okay, sorry about the LONG delay in posting a response... just about a year!
I was once again having a problem getting the CS_AddinFramework to run in debug without getting the "Error - Missing" message in EA. Somehow last Friday it started working... I did not "change" anything that I know of... e.g. no EA.exe.config added, no registration of DLL, etc.
Now I have converted the CS example to VB, got it to build correctly (using .Net 2.0.0.0 references), and start debug and get the SAME error message?!!
I have tried adding the EA.exe.config file with the ref. to 2.0.0.0 to no avail... also tried 2.0.0 also...
ANYONE.. PLEASE... I am sitting here gnashing my towel!! HELP!!!
Thanks, and I hope everyone is having a great holiday season..
David