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 versio开发者_如何转开发ns of 64bit edition windows?
I am using Visual Studio 2010.
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.
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.
精彩评论