简体   繁体   English

适用于本机64位dll的32位Dll包装器

[英]32bit Dll wrapper for native 64bit dll

I have created a 64 bit dll using c++. 我已经使用c ++创建了一个64位dll。 Is it possible to have ac# 32bit dll as a wrapper to above 64bit dll? 是否可以将ac#32位dll作为以上64位dll的包装器?

I was able to get done work by creating a 64bit c# wrapper dll. 我能够通过创建64位C#包装器dll来完成工作。 But when I tried to have 32bit wrapper it doesn't work, Is it possible? 但是,当我尝试使用32位包装器时,它不起作用,这可能吗? or am I doing something never can be done? 还是我正在做一些永远无法完成的事情?

32-bit code can't (directly) call 64-bit code, and vice versa. 32位代码不能(直接)调用64位代码,反之亦然。 You have to transition modes, which can really only be done at OS-level. 您必须转换模式,这实际上只能在OS级别完成。 So although I'm not an expert on .Net/C#, I'd say "not possible". 因此,尽管我不是.Net / C#方面的专家,但我还是会说“不可能”。

You could build a standalone service process that runs in a 64-bit space and uses the 64-bit DLL, and use interprocess communication to pass data back and forth. 您可以构建一个在64位空间中运行并使用64位DLL的独立服务进程,并使用进程间通信来回传递数据。

Or compile the DLL as a 32-bit library... 或将DLL编译为32位库...

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

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