I am just starting MS Visual Studio 2005. My laptop has a 64 bit Intel microprocessor and the OS installed is 64 bit Windows 7. I created a DLL in VC++ 2005 using a Export Definitions File (.def) and then created an application on VB to test it.

The entire procedure was completed as instructed by my teacher and every thing was fine until I tried to run the application. The error returned was a BadImageFormat Exception (0x8007000B) and I have completely no idea what went wrong.

I have read the posts in these forums and I think it might be that VC++ 2005 creates a 32 bit (x86) version of DLL. Also I tried changing the format so that it produces a 64 bit (x64) version of DLL but it returned a different error on compilation. The machine module and the target module were incompatible.

Please help. I'm running out of time on this project.

Recommended Answers

All 3 Replies

Yes, it is true that the compiler produces 32-bit code, but that should not have been the problem. I also have 64-bit Windows 7 and never have a problem using 32-bit DLLs.

What version of VB are you tring to use?

What version of VB are you tring to use?

I'm using the Visual Studio 2005 developer itself. I've also tried using Visual Basic 6 under Visual Studio 98 but it hangs in the middle due to an incompatibility problem.

Visual Studio 98??? That is almost as ancient as I am. Upgrade your version of VB to a more recent one. Start out with the free VB 2010 Express to see if that resolves your problem or not.

commented: I didn't know you were a teenager! Are you old enough to be here? :o) +16
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.