469,890 Members | 1,448 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,890 developers. It's quick & easy.

Just your opinion about MFC and C++.NET

Hello!

Some information to be able to have a change to answer the question.
Assume I have a large system developed in MFC.
In this system we have only C++ code so no other language exist.
This system is 10 year old.

I just want your opinion about porting this system.
Assume it should be ported should it be to C++.net or C#.net.

I just want to know the advantage or dissadvantage between C++ and C# if you
have any idea.
I know the syntax is vary similar between C++, C# and Java.

//Tony
Nov 17 '05 #1
9 1236
Tony Johansson wrote:
Hello!

Some information to be able to have a change to answer the question.
Assume I have a large system developed in MFC.
In this system we have only C++ code so no other language exist.
This system is 10 year old.

I just want your opinion about porting this system.
Assume it should be ported should it be to C++.net or C#.net.

I just want to know the advantage or dissadvantage between C++ and C# if you
have any idea.
I know the syntax is vary similar between C++, C# and Java.

//Tony


Tony:

Not sure what you mean.

If you mean converting your MFC app from VC6 to VC7 or VC7.1 or VC8,
then you just need to recompile. This does not involve .NET at all.

If you mean completely porting the application to the .NET framework,
then this is a lot of work. I would certainly recommend that you wait
for Visual Studio 2005 (not much longer!). If you do that, and stay with
C++, there is a new language C++/CLI which is much nicer than the
managed C++ in VS 2002/2003. But, personally, I am avoiding anything to
do with .NET for now, so I have no real opinion on C++ vs C#.

David Wilkinson
Nov 17 '05 #2
This is getting confusing.

VB6,7,8 ?

..NET Framework?

Here I thought .NET enveloped all these.

Oooh my head hurts.

:-(

"David Wilkinson" <no******@effisols.com> wrote in message
news:OF*************@TK2MSFTNGP14.phx.gbl...
Tony Johansson wrote:
Hello!

Some information to be able to have a change to answer the question.
Assume I have a large system developed in MFC.
In this system we have only C++ code so no other language exist.
This system is 10 year old.

I just want your opinion about porting this system.
Assume it should be ported should it be to C++.net or C#.net.

I just want to know the advantage or dissadvantage between C++ and C# if
you have any idea.
I know the syntax is vary similar between C++, C# and Java.

//Tony


Tony:

Not sure what you mean.

If you mean converting your MFC app from VC6 to VC7 or VC7.1 or VC8, then
you just need to recompile. This does not involve .NET at all.

If you mean completely porting the application to the .NET framework, then
this is a lot of work. I would certainly recommend that you wait for
Visual Studio 2005 (not much longer!). If you do that, and stay with C++,
there is a new language C++/CLI which is much nicer than the managed C++
in VS 2002/2003. But, personally, I am avoiding anything to do with .NET
for now, so I have no real opinion on C++ vs C#.

David Wilkinson

Nov 17 '05 #3

"ProfitMaxTrading.com" <no****@nospam.com> wrote in message
news:CHv6f.5876$xE1.2922@okepread07...
This is getting confusing.

VB6,7,8 ?

.NET Framework?

Here I thought .NET enveloped all these.

Oooh my head hurts.

:-(

I'll attempt a clarification. Lets start by assuming you meant to type VC
instead of VB.
VC 6, 7, 7.1, 8 are referring to versions of the C++ compiler, which come
with Visual Studio 7, Visual Studio .NET 2002, Visual Studio .NET 2003 and
Visual Studio 2005, respectively.
All these versions of the C++ compiler support Windows application
development using MFC.
With Visual Studio .NET 2003, we got an additional technology for developing
Windows applications with C++, .NET Windows Forms which uses the .NET
Framework classes in place of the MFC classes.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 17 '05 #4
Peter van der Goes wrote:
VC 6, 7, 7.1, 8 are referring to versions of the C++ compiler, which
come with Visual Studio 7, Visual Studio .NET 2002, Visual Studio


VC6 (aka VC '98) is from Visual Studio 6, not 7.

-cd
Nov 17 '05 #5
Tony Johansson wrote:
Hello!

Some information to be able to have a change to answer the question.
Assume I have a large system developed in MFC.
In this system we have only C++ code so no other language exist.
This system is 10 year old.

I just want your opinion about porting this system.
Assume it should be ported should it be to C++.net or C#.net.

I just want to know the advantage or dissadvantage between C++ and C#
if you have any idea.
I know the syntax is vary similar between C++, C# and Java.


Syntax is the least or your worries - almost a non-consideration IMO.

Get VC8 and compile your app. You'll have somewhere between zero and
several thousand errors to fix due to language changes since VC6. While the
numbers may be daunting, these errors are usually easy to fix once you've
tackled the first few.

I wouldn't even consider "porting" a large MFC app to C# unless it's ready
to be completely retired. You'd have to re-write virtual every line of
code, and you'd have to do major re-architecting to fit into the Windows
forms paradigms instead of MFC. Many MFC concepts simply have no equivalent
in windows forms (e.g. documents, views), so you'd have to build
replacements for those features yourself. Finally, windows forms (even in
VS 2005) doesn't have the UI richness that's attasinable through MFC.

Having updated your app (I wouldn't call it porting) to VC8, you can now
consider whether you want to use .NET for new features going forward. The
version of MFC included in VC8 allows you to host .NET forms and controls
inside MFC views, so it makes it easy to use .NET to add new features to an
existing MFC application without re-writing the base application in another
language or framework.

-cd
Nov 17 '05 #6
Hello!

You say this and it sounds good.

Having updated your app (I wouldn't call it porting) to VC8, you can now
consider whether you want to use .NET for new features going forward. The
version of MFC included in VC8 allows you to host .NET forms and controls
inside MFC views, so it makes it easy to use .NET to add new features to an
existing MFC application without re-writing the base application in another
language or framework.

Now to my question. Assume we compile the MFC application in VC8. When we
want to add new feature to the application using .NET is it then possible to
use C# insted of C++. I just think that using C# instead of C++ will cause
less error beacuse it's an easier language. Compare this you create an
application quicker when using Java then C++ beacuse it's an easier language
and the possibility of strange errors in the future is much less with Java.

C# is quite similar to java.

//Tony
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
skrev i meddelandet news:e8**************@TK2MSFTNGP09.phx.gbl...
Tony Johansson wrote:
Hello!

Some information to be able to have a change to answer the question.
Assume I have a large system developed in MFC.
In this system we have only C++ code so no other language exist.
This system is 10 year old.

I just want your opinion about porting this system.
Assume it should be ported should it be to C++.net or C#.net.

I just want to know the advantage or dissadvantage between C++ and C#
if you have any idea.
I know the syntax is vary similar between C++, C# and Java.


Syntax is the least or your worries - almost a non-consideration IMO.

Get VC8 and compile your app. You'll have somewhere between zero and
several thousand errors to fix due to language changes since VC6. While
the numbers may be daunting, these errors are usually easy to fix once
you've tackled the first few.

I wouldn't even consider "porting" a large MFC app to C# unless it's ready
to be completely retired. You'd have to re-write virtual every line of
code, and you'd have to do major re-architecting to fit into the Windows
forms paradigms instead of MFC. Many MFC concepts simply have no
equivalent in windows forms (e.g. documents, views), so you'd have to
build replacements for those features yourself. Finally, windows forms
(even in VS 2005) doesn't have the UI richness that's attasinable through
MFC.

Having updated your app (I wouldn't call it porting) to VC8, you can now
consider whether you want to use .NET for new features going forward. The
version of MFC included in VC8 allows you to host .NET forms and controls
inside MFC views, so it makes it easy to use .NET to add new features to
an existing MFC application without re-writing the base application in
another language or framework.

-cd

Nov 17 '05 #7
"Tony Johansson" <jo*****************@telia.com> wrote in message
news:oY*********************@newsc.telia.net...
Now to my question. Assume we compile the MFC application in VC8. When we
want to add new feature to the application using .NET is it then possible
to use C# insted of C++. I just think that using C# instead of C++ will
cause less error beacuse it's an easier language. Compare this you create
an application quicker when using Java then C++ beacuse it's an easier
language and the possibility of strange errors in the future is much less
with Java.


When you are using the Visual C++ "It just works" feature, you can compile
C++ code to .NET code. This .NET code can use any .NET component created by
any .NET language.

If you really want to use C# for the most part, you would compile your
existing code via IJW (at least the one that should be extended with managed
features) and write some C++/CLI code that calls your C# code. However, you
would end up in a situation where you use 3 different languages: C++,
C++/CLI, and C#. I am not sure if this is really what you want.

Re: IJW, I am probably doing a webcast about how IJW works. If it is
interesting for you, I will post you a link when it is done.

Marcus
Nov 17 '05 #8

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:eY**************@TK2MSFTNGP10.phx.gbl...
Peter van der Goes wrote:
VC 6, 7, 7.1, 8 are referring to versions of the C++ compiler, which
come with Visual Studio 7, Visual Studio .NET 2002, Visual Studio


VC6 (aka VC '98) is from Visual Studio 6, not 7.

-cd

Argh! Typo on my part. Thanks for pointing that out, Carl!

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 17 '05 #9
If the program you're describing uses MFC to do document/view and makes
heavy use of other MFC classes I would try to stay with it going forward
unless you have a compelling reason to switch to C#. You can move parts of
your program to managed code that are not necessarily performance restricted
and/or where you want to use .NET functionality. My feeling is that C# will
develop as time goes on to have more things that MFC currently has, but that
doesn't seem to be the case at this time.

IOW, a lot depends on what your program is doing. If you've written a
web-service using MFC, for example, I would hurry up and switch it to .NET
using C#. If you use MFC ISAPI, um, my opinion, is that you shouldn't these
days.

Tom

"Tony Johansson" <jo*****************@telia.com> wrote in message
news:yK*********************@newsc.telia.net...
Hello!

Some information to be able to have a change to answer the question.
Assume I have a large system developed in MFC.
In this system we have only C++ code so no other language exist.
This system is 10 year old.

I just want your opinion about porting this system.
Assume it should be ported should it be to C++.net or C#.net.

I just want to know the advantage or dissadvantage between C++ and C# if
you have any idea.
I know the syntax is vary similar between C++, C# and Java.

//Tony

Nov 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

38 posts views Thread by Kevin Smith | last post: by
54 posts views Thread by smnoff | last post: by
15 posts views Thread by =?Utf-8?B?TWljaGVsIFBvc3NldGggW01DUF0=?= | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.