tags:

views:

1423

answers:

3

I have a 32 bit in-proc STA VB6 dll. I sadly cannot do anything about this. My C# component greatly benefits from being 64 bit. Is there anyway to call/interface with this 32-bit dll from my 64 bit process? Any sort of wrapper or anything?

+9  A: 

There's no direct way you can do this.

Since you can't port the VB6 inproc dll I'd suggest you write a 32bit out of process server that implements the same interfaces and have it delegate down to the VB6 code. Then, your 64bit app can call the out of process server as COM will take care of marshaling the types between the processes.

It ain't pretty, bit it will work!

Sean
+4  A: 

The 32bit COM component will have to run out of process.

Before embarking on creating a wrapper, check out whether COM+ (Object Services) will host it.

Richard
Hosting in COM+ as a server application I think would work. Course depends on the dll but great idea.
JoshBerke
Hi Richard, I'm very unfamiliar with COM+. Could you expand on your answer a bit (or direct me to resources on how to do this)? Thank you for the help.
Steve
My COM+ skills are out of date, it has been a few years since I had to seriously work with COM+. Ensuring you initialise DCOM security is a must, after that follow MSDN.
Richard
+5  A: 

This article Dealing with Legacy 32-bit Components in 64-bit Windows help you :

I have found this solution, see in article :
• Converting a project type from in-process to out-of-process
• Using COM+ as a host (this work for me)
• Using dllhost as a surrogate host

lsalamon