Thursday, June 16, 2011

How to Run 32-Bit DLL on 64-Bit Operating System

When I encountered the problem which 32-Bit DLL doesn't work on 64-Bit operating system - Windows 7-,  I tried to register 32-Bit DLL. But it's futile and I was on wrong way.

In my case, I use 32-Bit DLL on windows desktop application which I built. When I start up the application it throws an error. Without 32-Bit DLL, it works nicely.

The solution for this issue is easier than you think by using Visual Studio 2008 or 2010. The only thing you accomplish is to compile your application for 32-Bit operating system if you don't have a good reason to run your application on 64-Bit OS.

If you use Visual Studio 2008, you can perform following steps :

  • Click Debug/Release drop down list to open Configuration Manager.
  • In new window, you see Active Solution Platform drop down list. In this list, select New, then choose x86

If you use Visual Studio 2010, you can perform same steps, but you have to enable Advanced Build Configurations. In order to use Configuration Manager, follow steps written below : 
  • On you Visual Studio 2010, click Tools on Visual Studio menu and select Options
  • You see new window. In this window expand Projects and Solutions and click General section then check Show advanced build configurations.

  • Lastly, do same steps mentioned above for Visual Studio 2008. 
Eventually, you are ready to compile your application for 32-Bit. 

0 comments: