Click to See Complete Forum and Search --> : from unManaged Extension to Managed Extension c++.net


BeePo
February 4th, 2005, 04:07 PM
Hi Gurus!!
I am facing a big problem.
I have a MFC Dialog based application. Using TreeCtrl, ListCtrl, and some other MFC Controls.
I want to use some of the .Net Framework classes..
I decided to use the Managed Extension.
So I changed YES to use Managed Exension of Project Properties.
After that, I got the following errors at this statement. (note: that statement is in red which is a very first statement I wrote in the project is the error statement)

mytree.SetImageList(&m_NormalImageList, TVSIL_NORMAL );// setting images as folder
mytree.SetImageList(&m_StatusImageList, TVSIL_STATE ); // setting images as checkb
HTREEITEM hitem = mytreel.GetRootItem();

//error message
An unhandled exception of type 'System.TypeLoadException' occurred in potree.exe

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

If I don't set Use Managed Extension Property, YSE to NO back, the program is running back again without any error.

Why I can use CListCtrl and can't use CTreeCtrl?
What am I doing wrong?