I need to access a 32bit dll from a 64bit exe

☆樱花仙子☆ 提交于 2019-12-06 06:05:52

问题


I know I read all about surrogate process, and I was able to create a surrogate COM but it either all works in 32bit or all works in 64bit.

What would be the correct structure?

1) 32.dll <- 64.com <- 64.exe 2) 32.dll <- 32.com <- 64.exe

I tried both of the above but I did not succeed to call the 32.dll?


回答1:


I'm not too informed about the surrogate COM you refer to but I've solved this problem (Using a 32bit dll from a 64bit exe) by introducing a COM object in the middle:

32.dll <-> 32bit-out-of-process-com-server.exe <-> 64.exe.

Sorry this might be what you mean by 32.com, not sure, but make sure the intermediate COM object lives in an .exe (out of process) and not in a dll. This is for the same reason you can't load the original 32.dll into the 64 bit process.




回答2:


This is defenetly what you want: 32.dll <- 32.com <- 64.exe If it does not work, show more details HOW it does not work.

Also, if you are not doing much calls, you may communicate via sockets (just a backup plan).



来源:https://stackoverflow.com/questions/3778754/i-need-to-access-a-32bit-dll-from-a-64bit-exe

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