how to use MFC in C++/CLI

M

ma

Hello,

I have several classes in C++/MFC that I would like to use when I am
using C++/CLI windows form.



I did create a windows form application in VC2005 and when I am trying to
add my class to it, it doesn't accept them and generate error compiling MFC
header files.



I think the problem is somewhere in project setup. Currently it is /clr:pure
which I think means that I can only use pure CLI objects. What can I do to
solve the problem? Is there any document that show how I can use MFC based
classes in windows form?



Best regards
 
J

Jochen Kalmbach [MVP]

Hi ma!
I have several classes in C++/MFC that I would like to use when I am
using C++/CLI windows form.

I did create a windows form application in VC2005 and when I am trying to
add my class to it, it doesn't accept them and generate error compiling MFC
header files.

Which errors? This should be possible...
I think the problem is somewhere in project setup. Currently it is /clr:pure
which I think means that I can only use pure CLI objects.

Yes. This might lead to problems... you should use "/clr"...
What can I do to
solve the problem? Is there any document that show how I can use MFC based
classes in windows form?

AFAIK, the documented way is to use Windows-Forms inside MFC-Apps...
http://blog.kalmbachnet.de/?postid=70

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 

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

Similar Threads


Top