简体   繁体   English

为64位dll创建32位包装器。 这可能吗?

[英]Creating a 32 bit wrapper for a 64 bit dll. Is this possible?

I have a couple of dlls that are x64 , with the x86 versions not being released yet. 我有几个x64的dll,而x86版本尚未发布。 I want to use these in a x86 environment. 我想在x86环境中使用它们。 There is no way to change any of the platforms of those factors. 无法更改这些因素的任何平台。

I have tried searching the Internet, but to no avail. 我曾尝试搜索Internet,但无济于事。 What I want to do is somehow create a x86 library that can communicate with the x64 ones. 我想要做的是以某种方式创建一个可以与x64通讯的x86库。 Is this possible at all? 这有可能吗? If so, how? 如果是这样,怎么办?

Preferably, the wrapper will be in C# code, though it has to be able to access C++ dlls. 包装程序最好使用C#代码,尽管它必须能够访问C++ dll。 (The x64 libraries are written in unmanaged C++ .) x64库是用unmanaged C++编写的。)

You cannot do this within a single process. 您不能在单个过程中执行此操作。 That's because a 32 bit process can only load 32 bit modules, and a 64 bit process can only load 64 bit modules. 这是因为32位进程只能加载32位模块,而64位进程只能加载64位模块。

The only way for your 64 bit code to call 32 bit code, and vice versa, is to use an out-of-proc solution. 64位代码调用32位代码(反之亦然)的唯一方法是使用过程外解决方案。 For example an out-of-proc COM server. 例如,进程外COM服务器。

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

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