Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: aquila2005 on August 08, 2007, 04:12:24 am
-
Hello
I am new to EA (using version 6.1) and I find it very effecient... As an ex-Rational Rose user when I created my VB.Net class I was expecting to find a menu option to import the definition (from the .dll or the .olb file) of the COM objects I need to inherit from (implemented in my class)...
I was expecting EA to automatically add thhe the method I need to implement in my class...
But how to add these COM references to my project???
I can only import XML stuff! Is there a way to do this? Import a COM library (olb file) into a project and use all the COM objects defined therein to build my own COM classes (you guessed that I need to implement and add functions to existing COM classes)
any help will be much appreciated..
thanks.
-
When you create a COM library in .Net, you need to set some attributes to make the classes, attributes and methods visible to COM.
I don't have them in front of me, but you will find the necessary information in the .Net help, or you can create a COM library - this is not the same as a 'normal' class library - and inspect the code. You might also see what you need by inspecting something like a COM wrapper in the VS Object Browser.
Having done that, you might be successful.
HTH, David
PS: If you are simply trying to reverse engineer a COM application, you are (almost) out of luck. EA will only do this with .Net and Java libraries. But...
Try creating a .Net interop assembly for your COM object. You should be able to reverse that, and will likely get something usable.
-
hmmmm
I see... I was expecting a tool to import COM definition (.idl file or .olb or even .dll) directly into EA.
For exemple, I am using ESRI.ArcGIS.Geodatabase in my .Net VB class. I would like to represent a COM class from that library as a "imported object" I could then use as aggregate or even to inherit from and build my classes... I even hoped it would automatically add all the method I need to override when I implement a COM interface...
AS I said, I am new to Ea, so I'll continue playing around...
thanks
-
Try the Import Binary from the Package Context Code Engeneering menu.
-
that looks more like what I had in mind...
expect finding the .dll that matches the .olb is prooving difficult... but I'll get to it :)
once imported, where are the classes??? I was expecting EA to create a new model or package and to see all the classes created nicely displayed with relationship etc...
thanks for your help...
-
AFAIK they are imported in the package where you invoke the context menu. You should have had open a class diagram within that package as the imported elements are place on this very diagram. EAUI
-
The binary importer doesn't support importing COM. It only supports Java and .Net. If want a different type of format handled I recommend you send in a feature request (http://www.sparxsystems.com.au/support/feature_request.html).
-
Actually one workaround to import COM into EA is to use tlbimp to import a COM engine and generate a .NET assembly RCW.
The .NET assembly can then be imported into EA.
I was going to claim that I haven't actually done this, but I can do better. The results of doing this can be seen by at http://sharepoint.standardcase.com/external/eaug/Shared%20Documents/Forms/AllItems.aspx or by downloading the following and importing it into EA. http://sharepoint.standardcase.com/external/eaug/Shared%20Documents/Interop.EA.dll.xmi.zip
-
thanks.
That is working as expected. I can import COM objects and .Net assembly.
Thanks again for all your help.
a+