Yanshof
Yanshof

Reputation: 9926

Compile my 32 bit project with C++ dll 64 bit

I have some legacy C# application ( 32 bit ) that work with some C++ 3rd party dll ( not com .. just simple unmanaged C++ )

One of those 3rd party dll just release new dll version - and this version is not 32 bit any more - its 64 bit.

I can't compile my code to 64 bit.

How can i continue work with this new version of 64 bit dll ?

Upvotes: 0

Views: 64

Answers (2)

David Heffernan
David Heffernan

Reputation: 612784

You cannot load a 64 bit DLL into a 32 bit process. Or indeed vice versa FWIW. It follows that you'll need two processes and IPC.

An out of process COM server would probably be the simplest way to proceed.

Upvotes: 1

1800 INFORMATION
1800 INFORMATION

Reputation: 135245

Maybe the simplest way would be to write a COM wrapper for the third party dll. I'd probably write that in c# because I'm lazy af but it could be C++ if you liked. Then you could call that wrapper, but it would have to be out of proc because you can't call across bitness in proc, but you knew that.

Upvotes: 1

Related Questions