none
Porting to Visual Studio 2010 breaks COM calls

    Question

  • We have a Visual Studio 2005 solution using some COM objects. This solution has been in production for nearly 10 years and have not encountered problems with COM. We are in the process of moving the solution to Visual Studio 2015 and are taking an incremental approach (2008 then 2010 then 2012, etc). The port to VS2008 was successful, but after porting to VS2010, we are encountering failures when calling CoCreateInstance - error code CO_E_SERVER_EXEC_FAILURE.

    Does anyone have an idea what might make this code break after moving to VS2010? Is this a build environment issue? SDK? Runtime issue?

    Thanks for any help!

    Paul

    Wednesday, September 21, 2016 7:58 PM

Answers

All replies

  • We have a Visual Studio 2005 solution using some COM objects. This solution has been in production for nearly 10 years and have not encountered problems with COM. We are in the process of moving the solution to Visual Studio 2015 and are taking an incremental approach (2008 then 2010 then 2012, etc). The port to VS2008 was successful, but after porting to VS2010, we are encountering failures when calling CoCreateInstance - error code CO_E_SERVER_EXEC_FAILURE.

    Does anyone have an idea what might make this code break after moving to VS2010? Is this a build environment issue? SDK? Runtime issue?

    Thanks for any help!

    Paul

    CO_E_SERVER_EXEC_FAILURE is pretty reliable in indicating that the COM server didn't fire up properly. That can be due to a variety of reasons, including incorrect installation or incorrect registry settings. It may have nothing to do with compilation.

    Try removing completely the registry settings (e.g. regsvr32 /u xxx, or server.exe /unregister) and confirm this by examining the registry with regedit. Then re-install and try again. If it still fails, then you simply go back to basic debugging by creating a small client test harness that instantiates the COM server and place a breakpoint on the server side to trace through the instantiation.

    Personally, I wouldn't have bothered with the "incremental approach". You are only creating unnecessary work for yourself IMHO.

    Wednesday, September 21, 2016 8:09 PM
  • Hi Voyager3,

    Thanks for Brian Muth's help.

    I suggest you try the suggestions that Brian Muth provided, which could help you find out what causes this issue.

    Are all these versions of Visual Studio on the same machine?

    If they are on different machine, I suggest you check the VS2010 machine, whether it has a high CPU load and the process takes a long time to call CoCreateInstance.

    Please check whether the COM server register for the right class IDs on current machine. More detailed analysis for this error, please refer to below blog.

    https://blogs.msdn.microsoft.com/adioltean/2005/06/24/when-cocreateinstance-returns-0x80080005-co_e_server_exec_failure/

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, September 22, 2016 5:47 AM
    Moderator