Hello,
I am using Enterprise Architect 12.1.0.1229
I would like to use the Automation API in Visual C++ 2010. I created a simple Win32 console project.
After trying a simple code like below for a console application, releasing the COM pointer I still see an EA process left running in the Windows task manager.
I am only trying to launch the Enterprise Architect COM server using the EA.App ProgID
HKEY_CLASSES_ROOT\EA.App\CLSID
{3A9E4F92-8D27-495B-8B22-1D702B3F0C83}
I succeed, but even after exiting the console application I see the EA.exe *32 in the list of processes
Can anybody help ? Thanks !
CoInitialize(NULL);
CLSID clsid;
OLECHAR wb[] = L"EA.App";
CLSIDFromProgID(wb, &clsid);
IDispatch* pDispatch;
HRESULT hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void**)&pDispatch);
if (FAILED(hr))
{
MessageBox(NULL,_T("CoCreateInstance failed"),_T("Enterprise Architect"),MB_OK);
return;
}
pDispatch->Release();
CoUninitialize();
I also tried this variation with the same result. After the application closes, I still have the problem of getting rid of the EA.exe *32 process
IUnknown* pUnknown;
HRESULT hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IUnknown, (void**)&pUnknown);
if (FAILED(hr))
{
MessageBox(NULL,_T("CoCreateInstance failed"),_T("Enterprise Architect"),MB_OK);
return;
}
IDispatch* pDispatch;
cout << "Client: Calling QueryInterface() for IDispatch on " << pUnknown << endl;
hr = pUnknown->QueryInterface(IID_IDispatch, (void**)&pDispatch);
if (FAILED(hr))
{
MessageBox(NULL,_T("QueryInterface failed"),_T("Enterprise Architect"),MB_OK);
pUnknown->Release();
return;
}
pDispatch->Release();
pUnknown->Release();
P.S. Can I attach files to this post ? I would like to attach some screen captures.