Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Owl Saver on November 19, 2009, 12:44:41 am
-
Can someone help point me in the right direction to solve this problem? I have just started creating a C# program to access EA models. When I try to open the model and EA is running, I get an exception. If EA is not runing, it works. First I get a pop up that says "Failed to Create Empty Document". Then I get the following exception:
"The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"
The code I am using is:
bool RetVal = false;
m_Repository = new EA.RepositoryClass();
if (m_Repository == null)
{
log.Fatal("EA API could not be started.");
RetVal = false;
}
else
{
if (m_Repository.OpenFile(base.FilePath))
{
RetVal = false;
log.Fatal("Could not open " + base.FilePath + " in Read/Write mode.");
}
else
{
RetVal = true;
log.Debug("Opened file = " + base.FilePath);
log.Debug("================================================================================");
}
}
-
Mmm... Are you using the C# start template provided by Sparx guys?
/D
-
Michael,
That error you are getting has nothing to do with the C# program you are creating. I sometimes get that error too when I try to start a second (or third) instance of EA from within Windows.
A reboot usually helps for a while, after which the problem re-occurs. I don't really know what causing it.
Geert
-
If you haven't already, you might try opening up Task Manager and killing any EA processes that are hanging around in the background. I've had this happen especially when testing; the instances don't always shut down cleanly and after a while no new ones are created.
Stan.