Load 32bit DLL library in 64bit application

别等时光非礼了梦想. 提交于 2019-11-26 18:54:42
John Knoeller

Sorry, but you can only load a 32bit DLL into a 64 bit process when you are loading the dll as a datafile. You can't execute the code. http://support.microsoft.com/kb/282423

Microsoft recommends that you use interprocess COM to use 32 bit code with a 64 bit application. Here's an article explaining the process http://blog.mattmags.com/2007/06/30/accessing-32-bit-dlls-from-64-bit-code/ Its not fun.

There's a difference between reading a 32 bit executable and executing code within a 32 bit executable. I don't believe that windows offers any functionality to do that.

The only way you're likely to be able to do that is to create a 32 bit process that loads the dll and then do interprocess communication to pass the results between the two processes.

If all you're wanting to do is get resources from it, you can load as a datafile:

LoadLibraryEx(exeName, NULL, LOAD_LIBRARY_AS_DATAFILE);

Then call FindResource as normal.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!