How to use .NET Framework in MFC application with VS

  • Thread starter Thread starter allen zhang
  • Start date Start date
A

allen zhang

I had some codes written with MS VC6 MFC, Now I wanna use some .NET
framework functionality, such as Web Service, Can somebody tell me how to
implement it. Is it posible that an application is written with two diffrent
library concurently, MFC & .NET Framework. Any snippet code & article will
be appreciated!

Thank for your the advanced.

Allen Chang
 
Re-compile using the /clr switch and you should be able to access the Base
Class Library; you might have to make a few fixes though where you might
have used non-standard C++ which VC++ 7.1 won't compile but which VC 6
allowed.
 
Nish, thanks. But can you tell me how interoprate MFC with .NET class, for
example, I wanna pass a string variant in .NET to MFC CString variant. In
fact I wanna my MFC application can access .NET web services, my web
services will offer data service for MFC application. I have no any idea
about it.

Thank a lots.

Nishant S said:
Re-compile using the /clr switch and you should be able to access the Base
Class Library; you might have to make a few fixes though where you might
have used non-standard C++ which VC++ 7.1 won't compile but which VC 6
allowed.

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com /* MVP tips tricks and essays web site */
http://blog.voidnish.com /* My blog on C++/CLI, MFC, Whidbey, CLR... */


allen zhang said:
I had some codes written with MS VC6 MFC, Now I wanna use some .NET
framework functionality, such as Web Service, Can somebody tell me how to
implement it. Is it posible that an application is written with two diffrent
library concurently, MFC & .NET Framework. Any snippet code & article will
be appreciated!

Thank for your the advanced.

Allen Chang
 
You'd have to do a lot of managed/unmanaged type conversions. There are some
articles on MSDN and web sites like CodeProject that explain how to go about
doing that. There is no easy or general way of doing things. You have to
approach things based on their specific aspects.

I've co-authored a book that talks about such issues (though the book uses
the soon-to-be-obsoleted MC++ syntax)

See : http://www.amazon.com/exec/obidos/ASIN/032117352X/103-6620436-5659025

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com /* MVP tips tricks and essays web site */
http://blog.voidnish.com /* My blog on C++/CLI, MFC, Whidbey, CLR... */


allen zhang said:
Nish, thanks. But can you tell me how interoprate MFC with .NET class, for
example, I wanna pass a string variant in .NET to MFC CString variant. In
fact I wanna my MFC application can access .NET web services, my web
services will offer data service for MFC application. I have no any idea
about it.

Thank a lots.

Nishant S said:
Re-compile using the /clr switch and you should be able to access the Base
Class Library; you might have to make a few fixes though where you might
have used non-standard C++ which VC++ 7.1 won't compile but which VC 6
allowed.

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com /* MVP tips tricks and essays web site */
http://blog.voidnish.com /* My blog on C++/CLI, MFC, Whidbey, CLR... */


allen zhang said:
I had some codes written with MS VC6 MFC, Now I wanna use some .NET
framework functionality, such as Web Service, Can somebody tell me how to
implement it. Is it posible that an application is written with two diffrent
library concurently, MFC & .NET Framework. Any snippet code & article will
be appreciated!

Thank for your the advanced.

Allen Chang
 
Back
Top