Migration from MFC to C# Windows Forms

S

Scott

I have written windows applications using MFC for several years and
have frequently used MFC techniques.

Now I'm moving to C# .NET WinForm. Mostly C# books describes C#
language (sometimes compared with C++) and then how to use Windows
Forms but without comparison with MFC.

Would you recommend any book or online stuff to guide migration from
MFC/Win32 to Windows Forms to save time and effort to learn new
environment. I realized that it is next to impossible to map
mechanically. At this time all I need conceptual migration or hints.

Examples I need are as follows (Right hand side answer could be
incorrct, because I'm a newbie)

MFC => .Net Windows Forms
MainFrame => ???
DOC/VIEW architecture => Nothing. Just dialog
Dialog resource file => Hard coded in C# file
CString => ???
Notify Message => Event...
Worker/UI thread => ???
ANSI/Unicode => ???
Timer => ???
 
D

Dave Quigley

Ok from the top

if you intend to do windows programming and not web programming Ide suggest
this book by microsoft press. Im using it to study for the MCSD exam and it
is good sofar.

MSPRESS Developing Window-Based Applications with Vb.net and VisualC#.Net
this is a good book..

Also I found this book amazing also its a new version of Programming windows
by charles petzold its Programming Microsoft Windows with c# by charles
petzold... They have a version of it in c++ but the new one is in c#.. Its
mentioned as a "core reference"

That will cover MFC and your questions about Events Threading ANSI/UNICODE
conversions and timers.

These are some good books for the topics. Im not suyre what you mean by
MainFrame though.. do you mean the windows that everything goes in or actual
MainFrame programming.

CString is replaced by a string object in .Net in c# its lowercase s on the
string but it is an alias for the .net class String.... Everything you would
have in the CString class can be found here or in a namespace close to it.

Events are complex to explain and should be accompanied by code examples so
get a book for it.

Threading look in System.Threading

Timer look in System.Timer its very easy to use and there are code examples.

for ansi/unicode look in System.Text.Encoding for the types of encodings
there are and how to use it.

Well thats all that im clear about if you can clarify Doc/view main frame
and Dialog resource file i might be able to help more.
 
J

Joerg Jooss

Scott said:
I have written windows applications using MFC for several years and
have frequently used MFC techniques.

Now I'm moving to C# .NET WinForm. Mostly C# books describes C#
language (sometimes compared with C++) and then how to use Windows
Forms but without comparison with MFC.

Would you recommend any book or online stuff to guide migration from
MFC/Win32 to Windows Forms to save time and effort to learn new
environment. I realized that it is next to impossible to map
mechanically. At this time all I need conceptual migration or hints.

Check out Chris Sells' book "Windows Forms Programming in C#". It has a
small chapter on migrating from MFC to Windows Forms. Actually, it's
pretty good book anyway ;-)

Cheers,
 
I

Ivar

Hi,

Consider using java insted of c#.
This msy save you future conversion c# to java, if some reason you need to
run your applications
on any OS.

I did such mistake, moved mfc to c# and now moving to java.
At first I didn't like java, but after using some month, day to day I like
it more.
You can do all with java as with c#.

See UI controls, they looks ok and they look same on linux,windows ... .
If you see source code it's very similar to c#.
http://www.lumisoft.ee/lsWWW/Download/Downloads/UI/Java/testUI/testUI.html
(Requires java 1.4)
 
S

Scott

Now I have a difficulty to install Java 1.4. I'll try the site you
suggested later.

Mostly, my customers use Windows. They don't need different UI or slow
performance. It was the reason why I chose C# instead of Java.

Would you recommend some more sites to compare Java and C#?
I'm interested if Java supports Rich edit control and OLE, how to
replace Windows registry...

Thank you

Scott
 
I

Ivar

They don't need different UI
That's because it's wise to write application java. "Write once,run
everywhere"
slow performance
Suggest to try latest java, if I compare my c# java results, I don't see any
speed difference for normal desktop app.
Would you recommend some more sites to compare Java and C#?
Don't know any good site.
if Java supports Rich edit control
Yes it's supports it.
not sure about it.
replace Windows registry
Is it wise to write settings to registry, then the application will be
Windows runnable only.
Usualy you can use xml files istead of it.
 
I

Ivar

You must debug .NET everywhaere too (win98,2000 ...)

only difference is that you have option to run your applications everywhare.
 
S

Scott

Ivar said:
That's because it's wise to write application java. "Write once,run
everywhere"

Sorry for confusing you.
I meant that people don't like UI different from Windows standard UI.

Scott
 

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

Top