Hemanth Nukala
Hemanth Nukala

Reputation: 1

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?

Upvotes: 0

Views: 602

Answers (1)

selbie
selbie

Reputation: 104474

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.

Upvotes: 1

Related Questions