locked
Cocreateinstance function failing with class not registered error RRS feed

  • Question

  • Hi,

    I have created 32bit COM dll.and trying to load same dll in 64bit COM service in 64bit windows xp,but cocreateinstance() call is failing with HRESULT 80040154  Class not registered.  I have registered dll with regsvr32.exe successfully.The same scenario is working on the Windows 7 64 bit machine.

    Can anyone please help me on this?


    Nandkumar T.


    • Edited by prxy Thursday, April 26, 2012 11:30 AM
    Thursday, April 26, 2012 11:27 AM

Answers

  • I suggest you make a 64-bit COM dll, and then load it in 64-bit COM service.

    Or you can load the 32-bit COM dll in a 32-bit COM service.

    that is to say, you had better make the COM dll and COM service of the same bit.


    Please mark this reply as answer if it helps you! Thanks for your cooperation! Good Luck to you.

    • Proposed as answer by Pintu Shukla Friday, April 27, 2012 5:02 PM
    • Marked as answer by Helen Zhao Thursday, May 3, 2012 2:58 AM
    Friday, April 27, 2012 8:29 AM

All replies

  • I suggest you make a 64-bit COM dll, and then load it in 64-bit COM service.

    Or you can load the 32-bit COM dll in a 32-bit COM service.

    that is to say, you had better make the COM dll and COM service of the same bit.


    Please mark this reply as answer if it helps you! Thanks for your cooperation! Good Luck to you.

    • Proposed as answer by Pintu Shukla Friday, April 27, 2012 5:02 PM
    • Marked as answer by Helen Zhao Thursday, May 3, 2012 2:58 AM
    Friday, April 27, 2012 8:29 AM
  • Hi,

    I have created 32bit COM dll.and trying to load same dll in 64bit COM service in 64bit windows xp,but cocreateinstance() call is failing with HRESULT 80040154  Class not registered.  


    Nandkumar T.


    Quite simply, you cannot load a 32-bit DLL into the address space of a 64-bit executable. Period. You need to create a 64-bit DLL equivalent.
    • Proposed as answer by Helen Zhao Thursday, May 3, 2012 2:58 AM
    Friday, April 27, 2012 4:07 PM