Kamahire
Kamahire

Reputation: 2209

how to use win 32 bit dll in 64 bit application

I have 32bit third party dll. I am using same dll in c# application. How can I run this application in 64bit evironment like windows 7. It is desktop application.

Upvotes: 0

Views: 485

Answers (1)

Thomas
Thomas

Reputation: 64635

There are a couple of ways if you are using a Windows application. The easiest solution I've found is to put the 32-bit DLL in a COM+ Application. When a COM+ Application loads, it ensures that all libraries in the application have the same bitness. Granted, you will be required to call the DLL out of process.

That leads to another solution which is to create a 32-bit executable or service that hosts your application. It would mean that when your main application is running, that in fact two applications are running and you will incur marshaling costs but it would make it possible.

At the end of the day, the only way it is possible is for the 32-bit DLL to be hosted in a 32-bit process outside of your 64-bit process.

Upvotes: 2

Related Questions