Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: vibhugupta on April 30, 2008, 10:48:47 pm
-
I am developing a small EA DOORS integration project. I am able to export an EA model to DOORS. When I am trying to open EA exported model from DOORS it gives error and EA closes down.
I am trying C# following code:
try
{
app = (EA.App) System.Runtime.InteropServices.Marshal.GetActiveObject("EA.App");
de=(EA.RepositoryClass) app.Repository;
de.OpenFile(fName);
return;
}
please help me.
-
...
When I am trying to open EA exported model from DOORS it gives error and EA closes down.
...
What is the "it" you refer to, and what is the error?
-
That code appears to be trying to get an already open EA application. If you don't have one it would fail when accessing app.Repository, so either try adding a null check.
-
I see this is not DXL code - what version of DOORS are you using?
If the code is not on the DOORS side - are you seting this up as an EA-addin? If so the Repository is already set if you are using the standard ADD-In code i.e. see EA_GetMenuItems(EA.Repository Repository, ...)