Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

64-bit talking to 32-bit DLL?

Status
Not open for further replies.

Insider1984

Technical User
Feb 15, 2002
132
US
Hi guys. I have a motion controller which is nothing more than a serial port device. The dll is old and written in 32-bit. I have an "interface" dll which wraps and does a DLL import on the DLL itself (along with a few other motor controller dlls to make a common interface).

On a 64-bit PC. if the application is compiled in 32-bit.... everything works great. If it is compiled in 64-bit the call into the manufacturer's 32-bit fails. If I try to compile my interface in 32-bit but the application in 64-bit the application exceptions when it enters the function that calls to the dll.

the exception is something about "the wrong format".

I would guess there is a way around this but a search online didn't return much.

=====================
Insider
4 year 'on the fly' programmer
C, C++, C#, MFC, Basic, Java ASP.NET
 
Hmmm. This ought to work, as the Wow64 runtime ought to create a 32-bit thunk for you.

But anyway, a workaround would be to create a 32-bit assembly that does your interfacing with the DLL. You can then create a 64-bit solution that references it. You'd have to manage two solutions (one 32-bit, one 64-bit), but the call between them ought to be transparent to you.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top