问题
I have 32 bit application using 32 bit third party library. Now I have to make my application 64 bit , so that it can take advantage of 64 bit address space ( large memory ). Since I can not load 32bit library into 64bit application process, I am thinking of creating 32bit executable wrapper over third party library and communicate from my 64 bit app using IPC ( named pipe/socket ). So my question is would their any issue in doing so ?. Also if I have to install my application on 64 bit systems, all files related to my application will be copied to "c:\Program Files" directory. Now can I keep my 32 bit third party exe wrapper in the same "c:\Program Files" or I need to copy to "c:\Program Files(x86)" directory ?
回答1:
This is exactly the way Microsoft recommends for such kind of problems. If you are working with COM, you can make COM exe server. For .NET use WCF. In your case - native C++, no COM - memory-mapped file or pipe is a good choice.
Regarding installation destination folder - you need to test this with the tool used to build installation packages. If the whole installation target is 64 bit, and single executable is 32 bit - the tool may show warning about this file. When the file is executed, it doesn't matter whether it is in Program Files or Program Files (x86), or any other directory.
来源:https://stackoverflow.com/questions/8489523/64-bit-application-communicating-with-32bit-process