I\'m calling functions from a 32-bit unmanaged DLL on a 64-bit system. What I get is:
BadImageFormatException: An attempt was made to load a program w
In Visual Studio, Right Click your project -> On the left pane click the Build tab,
under Platform Target select x86 (or more generally the architecture to match with the library you are linking to)
I hope this helps someone! :)