Last post Aug 12, 2007 09:27 PM by firstname.lastname@example.org
Aug 09, 2007 05:27 AMemail@example.com|LINK
I have a managed C++ Dll which compiled by Visual Studio 2003,and I migrate it to Visual Studio 2005 these days,and call it by some C# applications.Unfortunately it always report error:"is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)",I
also can not tarce into it,for once I refer the class in the dll,the C# console application will report that error when I press F5!
Please suggess me if any one have solve.
visual studio 2005
visual studio .net 2003
Aug 09, 2007 08:28 AM|DarrellNorton|LINK
First, make sure you are compiling in the proper mode. Check Visual Studio 2005's Configuration Manager (Build menu, Configuration Manager item) and select Win32.
Second, if you are missing a dll that the code references inside your Managed C++ dll (this is typically what happens), use
Dependency Walker to find out what's missing.
Aug 09, 2007 10:06 PMfirstname.lastname@example.org|LINK
First the debugger says "The specified module could not be found. (Exception from HRESULT: 0x8007007E)",
with the help of depends.exe,I fix the error.
But then the debugger says "BadImageFormatException was unhanlded(is not a valid Win32 application. (Exception from
Aug 12, 2007 09:27 PMemail@example.com|LINK
I correct this error just by commenting the follow code:
BOOL APIENTRY DllMain( HANDLE hModule,
Does anyone know why?Thanks