简体   繁体   中英

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. 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

"an attempt was made to load a program with an incorrect format. (exception from hresult: 0x8007000в)"

Is there anyway that I can run the application and refer the dll without changing all 400 projects to 32-bit architecture?

You can't load a 32-bit DLL in a 64-bit process.

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. An out of process COM EXE seems like the likely choice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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