Click to See Complete Forum and Search --> : Managed code problem


micke_932
December 17th, 2002, 08:43 AM
Hi !

I have an MFC application that I have changed to be compiled as a mangaged application (/clr) and it was running ok before, now when I run it it throws an exception like this:

An unhandled exception of type 'System.TypeLoadException' occurred in test.exe

Additional information: Could not load type _TREEITEM from assembly TestApp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.

The exception comes when it is about to call a method, and that method is doing some stuff with a treeview control (adding new items) so it's related to that in some way, but it runs just fine if I turn of /clr.

Has any one else run into something similar to this ?

Mikael

Calypso
March 20th, 2007, 05:19 AM
Hi guys,
is there anybody out there with a solution for the above descriped Problem?

I've got the same Error-Message, but I need the Managed-Code for the work with 'using namespace System::Data::OleDb' in my project, to import datasets out of an Access-Database and display them in multitabs with treeviews.

Thanks for help.
Calypso

thegrinch
March 20th, 2007, 09:13 AM
Hi!
I am no Pro in questions of managed code, but I am quiet very sure, that proting your app from MFC to .NET is not as easy as you think.
Things really work differently there. You would have to rewrite your app.
But you can try to export the calls to System::Data... into a (managed) dll that could eventually be called from "outside". Remember: all that managed code runs in a virtual machine!
so long