Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: vibhugupta on April 30, 2008, 10:48:47 pm

Title: Open EA from doors gives error
Post 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.
Title: Re: Open EA from doors gives error
Post by: «Midnight» on May 01, 2008, 12:02:12 am
Quote
...
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?
Title: Re: Open EA from doors gives error
Post by: Eve on May 02, 2008, 08:20:39 am
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.
Title: Re: Open EA from doors gives error
Post by: Dermot on May 02, 2008, 03:24:56 pm
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, ...)