Message 1 of 3
Sometimes GetActiveObject does not work...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When starting up sometimes GetActiveObject does not get hold of an already running Inventor.
I'm testing a program which uses a part which the program assumes is already loaded, but since GetActiveObject fails the whole program fails.
What could make GetActiveObject fail if a session is already open?
CLSID InvAppClsid; HRESULT hRes = CLSIDFromProgID (L"Inventor.Application", &InvAppClsid); if (FAILED(hRes)) { pInvApp = nullptr ; return ReturnAndShowCOMError (hRes,L"ConnectToInventor,CLSIDFromProgID failed") ; } // See if Inventor is already running... CComPtr<IUnknown> pInvAppUnk = nullptr ; hRes = ::GetActiveObject (InvAppClsid, NULL, &pInvAppUnk); if (FAILED (hRes)) { // ERROR: Inventor IS running but GetActiveObject fails // What can I do to investigate this error?
The COM error code is 0X800401E3.
The meaning is "operation not available" (translated from Italian).