Hi guys,

I am in the situation of having a 32bit dynamic COM library + headers which I can not rebuild but which I would like to use from within a 64bit application.

After some reading and testing I figured out that it should be possible to write a 64bit stub/proxy to access the DLL's functionality but so far I just partially succeeded.

Here is what I did so far.

a) Registered the (actually two) COM DLLs through regsvr32
b) Created a new (and empty) 'Application' Foo under 'Component Services' -> 'My Computer' -> 'COM+ Applications'
c) Added the previously registered 32bit components under 'COM+ Applications' -> 'Foo' -> 'Components'

After this, I created an empty console application (64bit configuration) and within the main function I tried to create instances of the registered components through

CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_ACTIVATE_32_BIT_SERVER)

which is working -- so far so good. Calling functions of the components works too, but not in all cases and this is my actual problem.

When I omit steps b) and c) from above, compile my test program for 32bit and instantiate components with CLSCTX_ALL everything works fine but as soon as I use the surrogate, the same test program fails - even in pure 32bit mode (i.e. calling a 32bit surrogate from a 32bit app).

The error I am receiving is "COM Surrogate has stopped working", and the function call's error handle says "The remote procedure call failed.". As suggested somewhere on the net, adding the 32bit COM surrogate (dllhost.exe) to the DEP exception list did not solve the issue.

I am absolutely not a Windows nor COM specialist and I assume and hope that I am doing something wrong and that there is a way to fix my problem. Any advice is appreciated.

Thanks in advance,
- Hauke