We have an old 3rd party component which is a 32 bit native dll. In our COM based app, we link it through Windows API. Now, we are planning to upgrade our app to .Net and running on 64 bit system. My question: Can we still link the old 32 bit native dll into our 64 bit .net app through Windows API? If not, any ideas on how to get it to work?
32-bit code cannot be used inside of a 64-bit process, period. However, you can wrap the 32-bit DLL inside of a 32-bit out-of-process COM server (if the DLL is already a COM server, then you can use a COM DllSurrogate to proxy it), then any 64-bit process (.NET or otherwise) can use that COM server as needed. Otherwise, you will have to set the .NET project to 32-bit instead of 64-bit. It will still run on a 64-bit machine, provided the WOW64 emulator component is installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With