-
September 30th, 2011, 02:17 PM
#1
64 bit DLLs in Windows
I'm sure this might seem like a dumb question one way or the other - but if I build a 32-bit app which somebody uses on Win64, can it use a 64-bit version of a third party DLL or does the whole chain need to be 32-bit? I'm assuming I can't mix & match because presumably, the app and all its dependencies would need to run in a 32-bit VM. Is that the case?
And what about the other way around? Can a 64-bit app use a 32-bit third party DLL or does the whole chain need to be 64-bit??
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
September 30th, 2011, 02:39 PM
#2
Re: 64 bit DLLs in Windows
Originally Posted by John E
I'm sure this might seem like a dumb question one way or the other - but if I build a 32-bit app which somebody uses on Win64, can it use a 64-bit version of a third party DLL
No.
It is easy to test:
Code:
#include <windows>
int main()
{
HMODULE hMod = LoadLibrary( "MyDLL" );
if ( hMod )
{
// Loaded successfully
FreeLibrary( hMod );
}
else
{
// Didn't load successfully
}
}
Assume this is a 32-bit application and MyDLL is a 64-bit DLL. What will happen (assuming that MyDLL would have loaded OK if the app was also 64-bit instead of 32-bit)?
Then make the same test vice-versa -- the app is 64-bit and the DLL is 32-bit.
And what about the other way around? Can a 64-bit app use a 32-bit third party DLL
No. The closest you can do is to launch a 32-bit process that uses the 32-bit DLL and then utilize some sort of IPC to communicate the results/data/whatever back to the 64-bit app.
Regards,
Paul McKenzie
-
September 30th, 2011, 03:01 PM
#3
Re: 64 bit DLLs in Windows
Thanks Paul. That's pretty much what I thought.
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
October 12th, 2011, 02:31 AM
#4
Re: 64 bit DLLs in Windows
Having looked into this a bit further I've noticed that it's becoming common on Linux for libraries to be distributed in "mixed 32/64" packages. From what I can gather, each module (lib / so) contains functions compiled both in 32-bit form and also 64 bit - so the same physical module can be used with either a 32-bit version of the app or a 64-bit version. I can (kinda) see the advantage of that but I'm guessing we can't do that with VC++?
"A problem well stated is a problem half solved.” - Charles F. Kettering
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|