简体   繁体   English

如何在 64 位 vb.net windows 应用程序中引用 32 位 dll

[英]How to reference a 32-bit dll in a 64-bit vb.net windows application

We are developing a windows form application in vb.net with over 400 projects in the solution and are built in 64-bit architecture.我们正在 vb.net 中开发一个 windows 窗体应用程序,该解决方案中有 400 多个项目,并且构建在 64 位架构中。 Now, we have an external dll of c++ type with 32-bit architecture which we are able to refer in our application, but throws an error like this现在,我们有一个具有 32 位架构的 c++ 类型的外部 dll,我们可以在我们的应用程序中引用它,但是会抛出这样的错误

"an attempt was made to load a program with an incorrect format. (exception from hresult: 0x8007000в)" “尝试加载格式不正确的程序。(hresult 的异常:0x8007000в)”

Is there anyway that I can run the application and refer the dll without changing all 400 projects to 32-bit architecture?无论如何,我可以运行应用程序并引用 dll 而不将所有 400 个项目更改为 32 位体系结构吗?

You can't load a 32-bit DLL in a 64-bit process.您无法在 64 位进程中加载​​ 32 位 DLL。

You'll need to implement a 32-bit bit EXE process to host the DLL and invent an IPC mechanism to broker calls to it.您需要实现一个 32 位的 EXE 进程来承载 DLL 并发明一种 IPC 机制来代理对它的调用。 An out of process COM EXE seems like the likely choice.进程外COM EXE 似乎是可能的选择。

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

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