Using a 32-bit dll on a 64-bit machine

I have an old project that uses a 32 bit dll. This works fine on a 32-bit processor, however, when I install the same project on a 64-bit OS, it does not work.

Is there a way to convert a 32bit dll to 64bit? Is there an alternative solution to solve my 32-bit DLL in a 64-bit OS?

+4
source share
1 answer

Your 32-bit dll should work fine on a 64-bit machine while it is loading into a 32-bit process - an attempt to load a 32-bit dll into a 64-bit process will fail.

If your project is .Net (e.g. C #), then you can target your build to x86 to get a 32-bit working dll correlation:

  • Right click on your project in Visual Studio and select "Properties"
  • On the Project Project Properties tab, make sure that the platform dropdown reads โ€œx86โ€ instead of โ€œAny processorโ€

If the target platform is โ€œAny processorโ€, then your project will usually target any platform, for example, a 64-bit OS - this will prevent the loading of a 32-bit dll.

If your project is not a .Net assembly, then the equivalent steps required to complete the above will be different.

Alternatively, you can try to get the 64-bit version of your DLL - if this is the DLL you created, you will need to port it to 64 bits yourself. If not, then you are dependent on the original vendors providing the 64-bit version.

+5
source

All Articles