I have a 32-bit exe that needs to dynamically load a 64-bit dll when it detects that the operating system is 64-bit. Is this possible through LoadLibrary? If not, is there another way to accomplish the same goal?
Asked
Active
Viewed 7,973 times
2 Answers
12
As previously mentioned, 32-bit code cannot load 64-bit code in the same process. You'll have to load it into a different process (CreateProcess() ?) and use IPC to coordinate.

Jaxidian
- 13,081
- 8
- 83
- 125
-
1Here's a link to a set of ways of doing IPC on windows: http://msdn.microsoft.com/en-us/library/aa365574(VS.85).aspx. Also check out my answer on another thread for more ways of doing this: http://stackoverflow.com/questions/446411/remote-procedure-calls/446615#446615 – Laserallan Mar 17 '10 at 23:46
2
You can't mix 64-bit and 32-bit code in the same process. You'll need a 32-bit version of the DLL.

nobody
- 19,814
- 17
- 56
- 77