Adding CLR support to MFC app causes common control problem 
Author Message
 Adding CLR support to MFC app causes common control problem

I have an MFC 4 app that I successfully ported to MFC 5
(.NET).  Everything worked fine until I added CLR support
and imported a .NET assembly that I wrote in C#.  I have
#using <mscorlib.dll> and #using "mylib.dll".

Now, when I run the application, I get:

System.TypeLoadException
Could not load type _TREEITEM from assembly MyApplication,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.

I am using the CTreeCtrl of MFC where the error occurs,
and for the life of me, I don't know why I am getting a
managed .NET exception here, since my .NET code is
somewhere else in the application.

Thanks in advance for any help!

Bg



Mon, 27 Jun 2005 01:58:33 GMT  
 Adding CLR support to MFC app causes common control problem
I added #pragma unmanaged to each method that utilized the
HTREEITEM construct, and it resolved my issue.  Adding it
to one method only did not fix the problem.

Quote:
>-----Original Message-----
>I have an MFC 4 app that I successfully ported to MFC 5
>(.NET).  Everything worked fine until I added CLR support
>and imported a .NET assembly that I wrote in C#.  I have
>#using <mscorlib.dll> and #using "mylib.dll".

>Now, when I run the application, I get:

>System.TypeLoadException
>Could not load type _TREEITEM from assembly
MyApplication,
>Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.

>I am using the CTreeCtrl of MFC where the error occurs,
>and for the life of me, I don't know why I am getting a
>managed .NET exception here, since my .NET code is
>somewhere else in the application.

>Thanks in advance for any help!

>Bg

>.



Mon, 27 Jun 2005 02:58:47 GMT  
 Adding CLR support to MFC app causes common control problem
If you search groups.google.com for:
_TREEITEM group:microsoft.public.dotnet.languages.vc.*

You'll see that current work around suggested is to define the
struct _TREEITEM{};


Quote:
> I have an MFC 4 app that I successfully ported to MFC 5
> (.NET).  Everything worked fine until I added CLR support
> and imported a .NET assembly that I wrote in C#.  I have
> #using <mscorlib.dll> and #using "mylib.dll".

> Now, when I run the application, I get:

> System.TypeLoadException
> Could not load type _TREEITEM from assembly MyApplication,
> Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.

> I am using the CTreeCtrl of MFC where the error occurs,
> and for the life of me, I don't know why I am getting a
> managed .NET exception here, since my .NET code is
> somewhere else in the application.

> Thanks in advance for any help!

> Bg



Mon, 27 Jun 2005 04:57:36 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. MFC support for IE5 Common Controls

2. Adding common controls to MFC Views

3. How to Add MFC support to win32 app?

4. Manually add MFC support to Win32 app.?

5. Adding MFC support to existing console app

6. BUG: EVC4 - Adding ATL Support to MFC App Fails

7. ATL COM Project with MFC Support causes problem with Processor Pack for VC.

8. Adding MFC Support to an ATL ActiveX Control...

9. Adding ATL support to MFC project - problem

10. Problem to add ATL support tp a MFC project

11. How to add Connection points support after added a control

12. Using .NET CLR on MFC APP??

 

 
Powered by phpBB® Forum Software