Migration of .NET COM object to 64 bit.

Posted by Victor Ronin on Stack Overflow See other posts from Stack Overflow or by Victor Ronin
Published on 2010-05-28T18:36:10Z Indexed on 2010/05/28 18:42 UTC
Read the original article Hit count: 364

Filed under:
|
|

Hi,

We have C++ application which uses several COM object. COM object are .NET based (using COM Interop).

I need to migrate application to 64 bit. I specifically need C++ application to be 64 bit. I don't want to recompile all of .NET com object to 64 bit and deliver two sets of DLL's (32 bit and 64 bit).

I was investigating and found that I can load 32 bit COM Dll's in 32 bit surrogate process using (DllSurrogate in registry). I know how to do that, but it means that all COM objects will become out of process.

In the C++ I had the code: CoCreateInstance(CLSID_SomeClass, NULL, CLSCTX_INPROC_SERVER, IID_SomeInterface, (void**)&pobj);

It worked fine, but as soon as I switch to CLSCTX_LOCAL_SERVER (and add registry keys for DllSurrogate), it can't find interfaces (error 0x80004002). I checked registry and found out that when .NET COM DLL is registered, it adds ClsID registry keys, but doesn't add Interface and TypeLib registry key.

The question is, how to create these registry keys for .NET COM?

Regards, Victor

© Stack Overflow or respective owner

Related posts about .NET

Related posts about c++