Author Topic: Open EA from doors gives error  (Read 3900 times)

vibhugupta

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Open EA from doors gives error
« 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.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Open EA from doors gives error
« Reply #1 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?
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Open EA from doors gives error
« Reply #2 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.

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Open EA from doors gives error
« Reply #3 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, ...)