loading x86-dll with LoadLibraryW in a x64-system

I try to change a printer-port monitor from x86 XP-system to Windows 7 (x64). In this monitor I load a dll dynamically with LoadLibraryW(...) and this is a 32-bit-dll. As one can run a 32-bit-application in a 64-bit-environment I guess that it should be possible to use a 32-bit-dll on a 64-bit-machine. But when I load it I get the error 0xc1 (193), telling me that it is "not a valid Win32 application". How have I to load this 32-bit-dll?
Thanks for your help, Peter
Who is Participating?
jkrConnect With a Mentor Commented:
No, you can only load 32bit DLLs from 32bit processes, not from 64bit processes. See http://blogs.msdn.com/oldnewthing/archive/2008/10/20/9006720.aspx ("Why can't you thunk between 32-bit and 64-bit Windows?")
formiAuthor Commented:
Thank's for your answer. I'll try to compile it in x64.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.