Hi there!
I need to call a legacy 32bit Dll from Excel x64. As Excel x64 does NOT support calling x32 Dlls I think that the only solution is to build a wrapper.
I found this article useful:
http://blog.mattmags.com/2007/06/30/accessing-32-bit-dlls-from-64-bit-code/ (http://blog.mattmags.com/2007/06/30/accessing-32-bit-dlls-from-64-bit-code/)
QuoteThe solution: a surrogate process
This issue can be solved by loading the dependency DLL into a separate 32-bit process space. The main module, running as a 64-bit process, can then access the dependency DLL across the process boundary using IPC (http://msdn2.microsoft.com/en-us/library/aa365574.aspx (http://msdn2.microsoft.com/en-us/library/aa365574.aspx)).
How do I do a surrogate process in asm?
Any clues?
Nothing special about it. Just a simple x32 process that loads the x32 bits DLL.
It will have to wait on an IPC mechanism (for example via network sockets) for a message from the x64 application and it will send back the results of the x32 DLL function call.
It is kind of a lot of work.
IMHO it is much better to rewrite the x32 DLL into an x64 DLL.
Probably (=haven't tested that), you can use CreateProcess, ShellExecute or similar to launch the 32-bit process, and e.g. SendMessage hWnd, WM_COPYDATA or similar to exchange data.
Thank you guys.
I'll stay with Excel32 for a long time.
:icon_eek: