views:

57

answers:

2

I have compiled a dll on Windows Server 2008 64 bit edition. It works fine on that version of Windows, but if I switch to Windows 7 or XP 64 bit edition the dll does not work. How can I make the dll compatible with all three versions of 64bit edition windows?

I am using Visual Studio 2010.

+3  A: 

You can use a program called Dependency Walker to see what dependencies your .dll file has, and eliminate the ones that are different between versions of Windows.

eplawless
I've tried that can u guide me where to place the the dlls in the either in the c:\windows\wow64system or the root folder where the dll is placed
Abdul Khaliq
+1  A: 

Check how _WIN32_WINNT and WINVER macros were defined in your DLL. To make your DLL compatible with Windows XP you should define them as 0x0501. That lets you find all dependency problems at compile time. More information about these macros you could find here.

Kirill V. Lyadvinsky
well in the linker settings under project settings use it is defined as WIN32;NDEBUG;_WINDOWS;_USRDLL;ADHANDLLERDLL_EXPORTS and also i am using SECURITY_WIN32 and WIN32_DCOM macros no _WIN32_WINNT and WINVER are defined in i think. I there is any ay to make the dll depend-less of any other os dlls?
Abdul Khaliq
Check `stdafx.h`, it could be defined there still. If `_WIN32_WINNT` wasn't defined explicitly then it will be set by the compiler to the highest possible value for the OS where you compile your DLL.
Kirill V. Lyadvinsky