0

CreateInstance() is returning 0x80080005 every time, when I am trying to create an Instance of running Com server (EXE). If the COM server is not running, CreateInstance() call get success every time and opens the COM server successfully.

For example: if I manually run the Com Server(exe), then I am not able to create instance of it.

Why I am not able to create an instance of running Com Server? Please help.

CoInitializeEx(NULL, COINIT_MULTITHREADED);

HRESULT hr = assistMgr.CreateInstance(__uuidof(AssistManager::AssistManagerApp));

if (SUCCEEDED(hr))
       printf ("%s: Create Instance Successful", __FUNCTION__);
else
       printf("%s: Unable to create object - 0x%X", __FUNCTION__, hr);
  • 2
    `0x80080005` is `CO_E_SERVER_EXEC_FAILURE`, see [When CoCreateInstance returns 0x80080005 (CO_E_SERVER_EXEC_FAILURE)](https://learn.microsoft.com/en-us/archive/blogs/adioltean/when-cocreateinstance-returns-0x80080005-co_e_server_exec_failure) and [Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))](https://stackoverflow.com/questions/22062284/) – Remy Lebeau Oct 15 '20 at 18:05
  • Please check [this official sample](https://github.com/microsoft/Windows-classic-samples/tree/master/Samples/Win7Samples/com/fundamentals/dcom/simple) to see if it reproduces the same issue. (Run sserver.exe first then start the sclient.exe, `CoCreateInstanceEx(CLSID_SimpleObject, NULL, CLSCTX_SERVER, pcsi, 1, &mq)` will execute `CreateInstance`) – Rita Han Oct 16 '20 at 03:30

0 Answers0