views:

290

answers:

2

Here is my problem:

I have developed an application which can be run on various platforms, including windows and unix. This app runs well on pure Win32 box (WinXP) or a pure Win64 (Win2K3 x64 edition) and other unix platforms.

It only fails when running on a 64 bit Win2K3 in 32 bit mode. This app invokes a third party dll at the runtime. And the third party dlls are not formally installed, but just copied to a location in the same env. I'm also sure I'm having the right version of these 3rd party dlls (I mean 32 bit version for 32 bit mode). Even I manually set the "path" in this testing box, it still doesn't work. The app is compiled and built in 32 bit mode in this Win2K3 box.

I run dependency walker and see the same error. Cannot find that 3rd party dll.

Can anyone please shed some lights on this? How do I make that 3rd party dll path visible to my app or the system?

Your help will be greatly apprecaited.

Thanks.

+1  A: 

I would suggest you to do the following:

  • ensure that you are using 32-bit version of the problematic DLL with 32-bit app
  • use filemon to see what paths your application tries while loading that DLL
  • check whether it works if you place that DLL into one of those paths
  • use dependency walker with that DLL itself - it might have its own unresolved dependencies
Andrey
Thanks for the suggestions. I copied the 3rd party dlls to the working directory. But the problem still exists. With dependency walker, it looks like the 3rd party dll is missing its dependencies, like MFC80.dll, etc. However, those missing files do exist in the system, but with two versions, one for x86 and one for x64. It might confuse the 3rd party dll. Question, is it possible to set path explicitly on Win2K3 x64 to run 32bit apps? I set the environment variables like "PATH", but seems not working.
awatto
your DLL is built with vs2005 which actually has two versions of runtime - pre-sp1 and sp1 (each library would have its own version, so that there are several version of the same library). Concrete version of runtime required by a DLL should be defined (most probably) in the embedded manifest inside of the DLL. Try looking into the manifest (as described here http://stackoverflow.com/questions/420852/reading-an-applications-manifest-file) and see whether you have corresponding versions of visual studio DLLs in System\WinSxS. If not - you'll need to install apropriate runtime redistributable.
Andrey
Thanks for this info. I'll try look into that. BTW, our app was built with VS 2003.Net on 64bit Windows for 32bit edition, and built with VS 2005 for 64bit edition. Does it make any difference in terms of looking for the right dll to load?
awatto
A: 

WOW64 redirects all calls by 32 bit applications to the System32 folder to the SysWOW64 folder. Is the third party DLL in the system32 folder? Because the system32 folder, contrary to what you'd expect, contains ONLY 64bit DLLs on Windows x64.

Billy ONeal
our third party dlls are placed in its own folder. But these dlls are not registered. they are simply copied to that location. they are not installed through any installer.
awatto