Problem using unmanaged static libs from managed C++ Windows Form Application in VC2005

A

Art

I have some Static libs which were intially implemented in VC6 and
then converted to VC2005.
When I try to use these in my managed C++ application, I am getting
the following exception:

An unhandled exception of type 'System.TypeInitializationException'
occurred in Unknown Module.

Additional information: The type initializer for '<Module>' threw an
exception.

Any comments/url is appreciated.

Here is the output :
-------------------------------------
First-chance exception at 0x1021c0a7 (msvcr80d.dll) in NewTestVC.exe:
0xC0000005: Access violation reading location 0xae59162c.
A first chance exception of type 'System.AccessViolationException'
occurred in NewTestVC.exe
First-chance exception at 0x7c96df51 in NewTestVC.exe: 0xC0000005:
Access violation reading location 0xae591630.
A first chance exception of type
'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
A first chance exception of type
'<CrtImplementationDetails>.ModuleLoadExceptionHandlerException'
occurred in msvcm80d.dll
First-chance exception at 0x7c812a5b in NewTestVC.exe: Microsoft C++
exception: [rethrow] at memory location 0x00000000..
An unhandled exception of type 'System.TypeInitializationException'
occurred in Unknown Module.

Thanks a lot for the help,
 
S

SvenC

Hi Art,
I have some Static libs which were intially implemented in VC6 and
then converted to VC2005.
When I try to use these in my managed C++ application, I am getting
the following exception:

An unhandled exception of type 'System.TypeInitializationException'
occurred in Unknown Module.

Additional information: The type initializer for '<Module>' threw an
exception.

Any comments/url is appreciated.

You must not use the static CRT when you compile managed code:

http://msdn2.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top