简体   繁体   English

用C ++ dll 64位编译我的32位项目

[英]Compile my 32 bit project with C++ dll 64 bit

I have some legacy C# application ( 32 bit ) that work with some C++ 3rd party dll ( not com .. just simple unmanaged C++ ) 我有一些旧的C#应用​​程序(32位)可以与某些C ++第三方dll(不是com ..只是简单的非托管C ++)一起使用

One of those 3rd party dll just release new dll version - and this version is not 32 bit any more - its 64 bit. 这些第三方dll之一刚刚发布了新的dll版本-此版本不再是32位-其是64位。

I can't compile my code to 64 bit. 我无法将代码编译为64位。

How can i continue work with this new version of 64 bit dll ? 我如何继续使用此新版本的64位dll?

Maybe the simplest way would be to write a COM wrapper for the third party dll. 也许最简单的方法是为第三方dll编写一个COM包装器。 I'd probably write that in c# because I'm lazy af but it could be C++ if you liked. 我可能会用C#编写该代码,因为我很懒,但是如果您愿意的话,也可以是C ++。 Then you could call that wrapper, but it would have to be out of proc because you can't call across bitness in proc, but you knew that. 然后,您可以调用该包装器,但是它必须不在proc中,因为您无法在proc中调用位,但是您知道这一点。

You cannot load a 64 bit DLL into a 32 bit process. 您不能将64位DLL加载到32位进程中。 Or indeed vice versa FWIW. 反之亦然。 It follows that you'll need two processes and IPC. 因此,您将需要两个过程和IPC。

An out of process COM server would probably be the simplest way to proceed. 进程外的COM服务器可能是最简单的处理方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM