Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I'm getting "An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"

Posted on 2011-09-12
2
Medium Priority
?
326 Views
Last Modified: 2013-12-17
hi -- I've recently tried to port my 32bit application to a windows 7 64 bit target. my development environment is on a 32 bit Vista system. after thrashing around with some other problems, this is the latest error i get. I think the error is coming from a dll that was written in c and compiled under an older version of VS. I use a p/invoke interface to unmanaged code to use it (it's a driver for a usb device.) I would rather not have to sort out whether i have the source code, etc for the dll. is there a "simple" way around this? I'm also using some assemblies from National Instrument that will not run without using their 64 bit merge modules, so the installer needs to declare it a 64 bit app.
I tried using CorFlags but it expects assemblies, not unmanaged code.
I'm using .net 4.0 and vs 2010.
thanks.
0
Comment
Question by:jdcoburn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 2000 total points
ID: 36527500
My understanding is that a .net program will run as 32 bit on a 32 bit machine and 64 bit on a 64 bit machine without you having to do anything.
This sounds like on the 64 bit machine there is then problems trying to use 32 bit dll's.

There should be a setting in the solution (project) properties that will force the .net environment to always use 32 bit .net code even on a 64 bit machine.  That may well be the solution for you.
0
 

Author Closing Comment

by:jdcoburn
ID: 36554178
hi -- the situation was more complicated. i eventually had to recompile a dll that linked to my app, plus pull through some other dll's that were 64bit only. anyway the solution got me started along an eventually successful path.
thanks,
Jim
0

Featured Post

A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question