|
| TypeLoadException with MFC |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.languages.vc.libraries.
| Klaus Schlegel |
| GOOD ANSWER |
I wrote a MFC Dialog Application with a TreeCtrl. With unmanaged C++ every think works fine, but after I enabled managed extensions the application crashed with a TypeLoadExeption. After I removed the CTreeCtrl::InsertItem calls from InitDialog I can start the application again.
Do someone have an idea ?
|
|
|
| |
|
|
| |
| |
| Ronald Laeremans [MSFT] |
| GOOD ANSWER |
Hi Klaus,
Can you report a bug on that with a repro?
Ronald Laeremans Visual C++ compiler team
"Klaus Schlegel" <Click here to reveal e-mail address> wrote in message news:#$OwX$cIBHA.1740@tkmsftngp03... [Original message clipped]
|
|
|
| |
|
|
| |
| |
| Anson Tsao [MSFT] |
| GOOD ANSWER |
The problem is because struct _TREEITEM{} is not defined in the common control header files. To fix the problem define the following in your stdafx.h
struct _TREEITEM {};
More info: HTREEITEM is defined as typedef struct _TREEITEM* HTREEITEM; for typesafety. In native C++, not having struct _TREEITEM define is not a problem, but in managed C++ functions that return HTREEITEM (such as CTreeCtrl::InsertItem()) will throw TypeLoadException when the CLR is trying to resolve struct _TREEITEM*.
Anson Tsao Microsoft Visual C++ Libraries
"Ronald Laeremans [MSFT]" <Click here to reveal e-mail address> wrote in message news:OCS3XZ3IBHA.1948@tkmsftngp05... [Original message clipped]
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|