none
How to call a 32 bit dll in 64 bit machine using DllHost and without using intermediate surrogate

    Question

  • Hi
    I want to make a call to 32 bit dll from 64 bit exe using dllhost and without using intermediated 32 bit exe.

    I am able to call a 32 bit dll from 32 bit exe through dll host on 32 bit machine.
    I am able to call a 64 bit dll from 64 bit exe through dll host on 64 bit machine.
    I am able to call a 32 bit dll from 64 bit exe by using 32 bit intermediated  exe and calling the CoCreateInstance without CLSCTX_LOCAL_SERVER.

    but the CoCreateInstance returns Class Not Registered when i try to call:
    A 32 bit dll from 32 bit exe through dll host on 64 bit machine.
    A 32 bit dll from 64 bit exe through dll host on 64 bit machine.

    I am suspecting that proper dllhost(32 bit DllHost) is not getting launched when calling CoCreateInstance with CLSCTX_LOCAL_SERVER.

    If my assumption is true please suggest me the proper method to call the CoCreateInstance to launch the 32 bit DllHost.

    Thanks In Advance
    Busetty Pavan Kumar

     

    Wednesday, July 01, 2009 4:53 AM

Answers

  • First make it work with 32-bit to 32-bit out of process.  Only then will you have a shot at making it work in the 64-bit to 32-bit case.  Out of process activation requires interface marshaling, typically done with proxy/stub DLLs.

    Hans Passant.
    • Marked as answer by Wesley Yao Tuesday, July 07, 2009 8:17 AM
    Wednesday, July 01, 2009 10:23 AM
    Moderator