
aidforsoft@mail.ru wrote:
Hello!
I need to use a DLL used Boost, in .NET projects. I wrapped this lib, but I cannot use the wrapping, because System.BadImageFormatException (is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)) raises at once, if I executing an application using the wrap.
Wrap scheme: Native DLL --- .NET Class Library --- .NET Project. I'm wrapping every class in native DLL into .NET class. I using some principles from the "Expert C++/CLI: .NET for Visual C++ Programmers" by Marcus Heege.
When I wrote a small test project, I discovered that if I only include anyone Boost header into native DLL, it set the System.BadImageFormatException permanently. Without Boost wrapping works perfectly.
I use: Boost 1.35.0 Visual Stidio 2005 SP1, 2008 - same results in all cases. Windows XP SP2 x86.
I found same problems in Internet - impossible to wrap native DLLs, used Boost. All this problems were unsolved. Such as: http://objectmix.com/dotnet/121318-not-valid-win32-application-exception-hre...
Just a thought: this may be related to a known issue with Visual Studio 2005 SP1: http://social.msdn.microsoft.com/forums/en-US/vclanguage/thread/73cb0f98-d15... https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedba... There are two suggested workarounds: https://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?Feedback... David