COM Wrapper for C++ DLL
-
Hi all, I have a C++ DLL that I "think" I need to make COM aware to make it work on both 32 and 64 bit windows processors. According to Microsoft site: "On 64-bit Windows, a 64-bit process cannot load a 32-bit dynamic-link library (DLL). Additionally, a 32-bit process cannot load a 64-bit DLL. However, 64-bit Windows supports remote procedure calls (RPC) between 64-bit and 32-bit processes (both on the same computer and across computers). On 64-bit Windows, an out-of-process 32-bit COM server can communicate with a 64-bit client, and an out-of-process 64-bit COM server can communicate with a 32-bit client. Therefore, if you have a 32-bit DLL that is not COM-aware, you can wrap it in an out-of-process COM server and use COM to marshal calls to and from a 64-bit process." (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win64/win64/process\_interoperability.asp)" Unfortunately, I don't have a whole lot of COM experience. Can anyone point me at some resource to help me out with this project? Anyone with good/bad experience doing this type of wrapper? Any suggestion, or help would be greatly appreciated. Thank you in advance, James
-
Hi all, I have a C++ DLL that I "think" I need to make COM aware to make it work on both 32 and 64 bit windows processors. According to Microsoft site: "On 64-bit Windows, a 64-bit process cannot load a 32-bit dynamic-link library (DLL). Additionally, a 32-bit process cannot load a 64-bit DLL. However, 64-bit Windows supports remote procedure calls (RPC) between 64-bit and 32-bit processes (both on the same computer and across computers). On 64-bit Windows, an out-of-process 32-bit COM server can communicate with a 64-bit client, and an out-of-process 64-bit COM server can communicate with a 32-bit client. Therefore, if you have a 32-bit DLL that is not COM-aware, you can wrap it in an out-of-process COM server and use COM to marshal calls to and from a 64-bit process." (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win64/win64/process\_interoperability.asp)" Unfortunately, I don't have a whole lot of COM experience. Can anyone point me at some resource to help me out with this project? Anyone with good/bad experience doing this type of wrapper? Any suggestion, or help would be greatly appreciated. Thank you in advance, James
Go to the COM and/or ATL section of code project. There are plenty of tutorials there. I've not done a wrapper for this explicit reason, but I've wrapped other DLLs before and its no big problem. The simplest way is to use the ATL Appwizard assuming you're using VC++. Kev