Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
Hi Guys,

I've built a DLL in C++ to use in a C# application. The DLL was built for Win32 but, according to Dependency Walker, it has 64-bit dependancies. What did I do wrong?

Also, am I correct in thinking that a 32-bit DLL can be used from a C# application running on either 32 or 64 bit systems?

Thanks.....
Posted
Comments
Albert Holguin 13-Apr-15 12:59pm    
What are the dependencies (maybe screen cap and place somewhere)? This really shouldn't be the case.

Hi Steve,
I was curious about this and after googling a bit I found as a possible solution to use a 32-bit Dep.walker for 32-bit binaries on a 64-bit system. Otherwise the results can be confusing. This seems to be explained for example in
https://social.msdn.microsoft.com/Forums/vstudio/en-US/a371bc8d-e16a-4d0a-8849-38ca60b4a7b4/32-bit-console-application-on-64bit-system-and-dependency-walker?forum=vclanguage[^]

Cheers,
 
Share this answer
 
Comments
Steve Harp 13-Apr-15 13:29pm    
This is correct for the question about dependencies. When I use the 32-bit version of Dependency Walker, it reports everything as x86.
peterkmx 14-Apr-15 2:38am    
Sounds good, thank you for providig feedback ...
Not enough information to say what do you do wrong.

You need to understand that you cannot mix different instruction-set architectures in one process. Not only 32-bit (x86) with 64-bit, but you cannot mix different 64-bit architectures (x86-64 (also known as AMD64) and IE-64 (Itanium), they are different). Please see:
http://en.wikipedia.org/wiki/Instruction_set,
http://en.wikipedia.org/wiki/X86,
http://en.wikipedia.org/wiki/X86-64,
http://en.wikipedia.org/wiki/Itanium.

Yes, you can use 32-bit DLL on a 64-bit OS, but how? Only in some 32-bit processes. On Windows, this is done via WoW64: http://en.wikipedia.org/wiki/WoW64.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900