Connecting Tech Pros Worldwide Forums | Help | Site Map

how to use MFC in C++/CLI

ma
Guest
 
Posts: n/a
#1: Mar 16 '06
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



Jochen Kalmbach [MVP]
Guest
 
Posts: n/a
#2: Mar 16 '06

re: how to use MFC in C++/CLI


Hi ma!
[color=blue]
> 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.[/color]

Which errors? This should be possible...
[color=blue]
> 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.[/color]

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

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/
Closed Thread