How to: 32-bit DLL running in 64-bit Windows 2008 Server

I have a 32-bit DLL that ran fine in Windows 2003 Server 64-bit.  Now I am forced to move up to Windows 2008 Server 64-bit, and I am finding that the DLL will not load.  The author told me that he believes it would not work in 64-bit OSs.

1) Get the author to recompile for 64-bit compatibility.  It is C++ code.  Should that be as easy as selecting a different build option?
2) For shorter term or if 1) does not work, can I successfully set the application pool to enable 32-bit applications?  An article online said that allows 32-bit DLLs to run. However, when I did make the suggested change to enable 32-bit code via IIS 7 Manager (Advanced Settings for the specific Application Pool), then the Web site itself would no longer run.  Are there other settings changes needed?  Another approach needed?

DavidPsychotherapist; Insight and Energy SpecialistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


You can run IIS 7 as 32 bit. It looks you have used DLL as ISAPI? If yes then you can add preCondition="bitness32" in Web.Config(define in handler)
DavidPsychotherapist; Insight and Energy SpecialistAuthor Commented:
Thank you, sindhuxyz.  But, can you provide more detail?  How to run IIS 7 as 32 bit.  And then you have the second part, about ISAPI and bitness etc.  Is that a second, alternative approach?

The DLL is called from ColdFusion 9, and I am not sure if it is ISAPI.  Where is the Web.Config...

Anyway, it seems more detail is needed for the answer (I can also research some of this, but have to go to a class in a few minutes).
This need a lot of technical detail to do it. Windows server 2008 is bit different then WIndows Serevr 2003. I can give you hint, use Google for more info:

1) Search how to use a DLL in Windows Server 2008(Adding Hanlder)?
2) When you successfully Add handler, it will create  code in web.config with preCondition="bitness64", change it to preCondition="bitness32"

Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage


If it is possible try get the developer to compile it into 64bit then get him recompile it. Unless he his using specifically 32bit library, compilation usual not give to much problem.  It will boost performance as your app do not have to be emulate or go thru 32it subsystem.

In order to run in 32 bit mode, you need to ensure that all the libraries and your web application must be compiled into 32-bit, The website won't work if some of the library or apps that are compiled using 64bit. I do not really about ColdFusion, but my suspect your CF is not 64bit, you need to install 32bit version, as far as I know by default CF will install 64bit on 64bit environment.

Opps.. "but my suspect your CF is not 64bit," -> not 32bit actually.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DavidPsychotherapist; Insight and Energy SpecialistAuthor Commented:
The technical steps for running the 32-bit DLL under 64-bit OS were not spelled out.  It did provide good tips in the right direction.  The alternate, recompiling, is simpler and I have already heard from the DLL author that they will try to recompile under "AnyCPU" option.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.