Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: donk15121984 on October 06, 2006, 01:03:46 am

Title: Generate C++ Addin
Post by: donk15121984 on October 06, 2006, 01:03:46 am
Hi @ all,
I have a problem when creating an C++ Addin. I have no idea to start. I need an addin with an easy menu. Could you give me a short expression how to create an addin in Visual Studio C++. My problem is that a can't register for COM interop and that my Regkey could not find.

Title: Re: Generate C++ Addin
Post by: MattAdamson on October 12, 2006, 11:28:47 pm
I don't understand why you need to register for COM interop, you would usually only do this for a .NET component.

I'm not aware of any C++ example add ins on the sparx website, strange perhaps given EA is written in C++. I would assume the technique would be to

a) Use the #import directive to import the EA.tlb in the C:\Program Files\Sparx Systems\EA directory.
b) Create a normal ATL object and define appropriate methods such as String EA_Connect(EA.Repository repository).
c) Create your registry key using the same .reg file which ships with the other add in samples, using the full prog id of your component.
Title: Re: Generate C++ Addin
Post by: Aaron B on October 15, 2006, 11:36:57 pm
We do not have any examples of a C++ Add-In on the Sparx website, but there was one posted to the EA User Group website some time ago by 'Paul Ourada':
http://sharepoint.knowledgerecovery.com/external/eaug/EA%20AddIns/CPP_AddinFramework.zip

I haven't had a proper look at it myself, but I believe this follows along a similar track as Matt said in the previous post.
Please note however, if you are using Managed (.NET) C++ then the configuration may be a bit different, such as needing to have a reference to Interop.EA.dll and not EA.tlb.