|
-
June 11th, 2012, 10:45 PM
#1
How to load dll which is win32 into x64 environment
Hi
In VS2010, I have VC++ class in x64 enviornment, when I use
HINSTANCE hDLL = LoadLibrary(L"test.dll"); => test.dll is win32
hDll is NULL
if I use
HINSTANCE hDLL =LoadLibraryExW(L"test.dll",NULL,LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE );
hDll has value.
but when I run
FUNC Setup2004;
Setup2004 = (FUNC)GetProcAddress(hDLL, "SetUp2004");
Setup2004 is NULL.
And, test.dll run in win32 enviroment with above program is well.
So, who could give me some suggestion?
Thanks
Angel
-
June 11th, 2012, 11:34 PM
#2
Re: How to load dll which is win32 into x64 environment
 Originally Posted by AngelDES
Hi
In VS2010, I have VC++ class in x64 enviornment,
Is your application a 64-bit app? If so, you cannot load 32-bit DLL's into the address space of a 64-bit application.
If it's not a 64-bit application, then call GetLastError() to determine why the DLL does not load.
Regards,
Paul McKenzie
-
June 12th, 2012, 12:06 AM
#3
Re: How to load dll which is win32 into x64 environment
 Originally Posted by Paul McKenzie
Is your application a 64-bit app? If so, you cannot load 32-bit DLL's into the address space of a 64-bit application.
If it's not a 64-bit application, then call GetLastError() to determine why the DLL does not load.
Regards,
Paul McKenzie
Hi Paul
Thanks to your reply.
Do you have any idea about how to load 32-bit DLL's into 64-bit app?
Because my app is 64-bit app, and I don't have this 32-bit DLL source code, so I cann't recompile this to be 64-bit.
Thanks
Angel
-
June 12th, 2012, 12:26 AM
#4
Re: How to load dll which is win32 into x64 environment
Do you have any idea about how to load 32-bit DLL's into 64-bit app?
Modules architecture must match. To load 32-bit dll your process must be 32-bit one. I heard some people been in such a desperate situation create a 32-bit COM server wrapping their problem dlls.
Best regards,
Igor
-
June 12th, 2012, 12:54 AM
#5
Re: How to load dll which is win32 into x64 environment
 Originally Posted by Igor Vartanov
Modules architecture must match. To load 32-bit dll your process must be 32-bit one. I heard some people been in such a desperate situation create a 32-bit COM server wrapping their problem dlls. 
Hi Igor
Thanks to your reply.
I also heard it can use TASK class to avoid this problem, but I don't know how to use? Who does know this and could give me some suggestion?
Thanks,
Angel
-
June 13th, 2012, 02:30 AM
#6
Re: How to load dll which is win32 into x64 environment
 Originally Posted by Igor Vartanov
I heard some people been in such a desperate situation create a 32-bit COM server wrapping their problem dlls.
I've done this once. But I didn't have any other choice that time. Anyway it's ugly and awful.
 Originally Posted by AngelDES
Who does know this and could give me some suggestion?
It’s impossible to load 34-bit DLL into the 64-bit application. If you really need this 32-bit DLL is there any specific reason you want your application to be 64-bit?
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
|