Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,
I need some help on using microsoft driectx directsound with Vb.net.
I'm using VS2010 EE on W7 pro SP1.
I can't get started i just get error massages like "An unhandled exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll".
I'm not experanced in using DLLs
please any help would be great.
thanks
RoboPike
Posted

1 solution

You're getting this message because you're trying to mix 32- and 64-bit code in the same process.

You probably compiled your application to target "Any CPU", which will run you're code as 32-bit on 32-bit Windows and 64-bit on 64-bit Windows. The problem with this is when you install 32-bit drivers on 64-bit Windows. Your app runs as 64-bit by default but the .DLL's you're trying to use as 32-bit only, thus causing the error that you're seeing.

Go into the "My Project" node in Solution Explorer and click on the Compile tab. Change the "Target CPU" dropdown to either "x86" or "x64" depending on the .DLL's you're trying to use. Try one, if it doesn't work, try the other if you don't know what you're loading.
 
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