none
Server execution failed - CoGetClassObject - 0x80080005

    Question

  • Hi All,

    Am very new to this forum. Kindly give a suggestion on this issue.

     

    We use the COM interop between two C++ project.

    1. COM C++ Client exe.

    2. COM C++ Server exe.

     

    If we run the client exe in application mode (using cmd), it will initiate the COM server exe and the instance creation also get success. And all the code done in the com server exe get success.

     

    But if we run the com client exe in service (by starting the service), Com server exe started while doing the Coinitialize(), but while doing the CoGetClassObject() it failed with the following errors.

     

    Event Type:    Error
    Event Source:    DCOM
    Event Category:    None
    Event ID:    10010
    Date:        9/23/2011
    Time:        7:28:44 PM
    User:        Test\Administrator
    Computer:    Test
    Description:
    The server {E454AB56-1950-4E49-BB77-3667F7ADA444} did not register with DCOM within the required timeout.

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


    CoGetClassObject - 0x80080005 - Server execution failed

     

    While running com client c++ code as service, it keep trying to run the CoGetClassObject() and failed in exactly 2 mins.

     

    Sample code :

    Client Code :

     

    HRESULT    hr = CoInitialize(NULL);
    if (hr == S_OK)
    {
        hr = CoGetClassObject(CLSID_OutLookWrapper, CLSCTX_LOCAL_SERVER, NULL, IID_IClassFactory, (void**)&pICF);
    }
    else
    {
        CoUninitialize();
    }

     

    CoGetClassObject - failed to create the instance.

     

    Server Code sample :

     

    int APIENTRY WinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR     lpCmdLine,
                         int       nCmdShow)
    {

        MessageBox(NULL, "COM Object main called", "COMServer", MB_OK | MB_SETFOREGROUND);
        HRESULT hr = S_FALSE;
        CoInitializeEx(NULL, COINIT_MULTITHREADED);//  COM object initialized Here.

    }

    Even i didn't get the message box output.

    To register the COM Server exe we followed the steps below :

     

    REGEDIT
    HKEY_CLASSES_ROOT\COMTest\CLSID = {E454AB56-1950-4e49-BB77-3667F7ADA444}
    HKEY_CLASSES_ROOT\CLSID\{E454AB56-1950-4e49-BB77-3667F7ADA444} = COMTest
    HKEY_CLASSES_ROOT\CLSID\{E454AB56-1950-4e49-BB77-3667F7ADA444}\LocalServer32 = C:\Test\bin\COMServer.exe

     

    We have followed the sample code from - http://www.codeproject.com/KB/COM/LocalCOMServerClient.aspx

    While analyzing the issue we noticed the following URL - http://support.microsoft.com/kb/187146#appliesto

    After follow the above link also we didn't able solve the problems.

     

    Can any one give suggestion on possible causes for this issue.

     

    Note : While running COM Client as application, all are working fine. But if we run the COM Client as service, the problem arise.

     

    Awaiting your response.

     


     




    Saturday, September 24, 2011 12:56 PM

Answers

  • DCOM initial sequence require some network traffic and AD/security checks.

    are you on a domain. have you configured DCOM settings ? you have configured service account.

    It's all about windows setting.

    sometimes, first instance can take up to 10 seconds.

    regards,

    Christophe PICHAUD

    MCSD, MCSD.NET, MCTS NET 2.0

    www.christophep.com

     


    Christophe Pichaud
    • Marked as answer by Rob Pan Tuesday, October 04, 2011 7:53 AM
    Thursday, September 29, 2011 4:23 PM

All replies