473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Migration from MFC to C# Windows Forms

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 => ???
Nov 15 '05 #1
3 6977
Well, although not a perfect match, here are the C# versions of MFC concepts

MainFrame: Form (that would be the main Form)
Doc/view: The wizard doesn't do this for you but you can always have this
architecture if you want.
Dialog resource file: You have everything written out to the
"InitializeComponent" method of the Form that's being designed.
CString: string
Notify Messages: You're right. They come as events.
Worker/UI threads: You set the "IsBackgroundThread" to true for worker and
false for UI (well, that's the general usage, although there's not a whole
lot of difference between the two; Background threads don't keep a process
alive without atleast one foreground thread)
ANSI/Unicode: You set the Encoding. Look up System.Text namespace
Timer: Timer. Windows Forms has a Timer component that you can add to any
Control.

Since you have plenty of experience in MFC, the samples in MSDN and the
Tutorials should be good enough to get you started off with C#.

Good luck!
-vJ
"Scott" <ba*********@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
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 => ???

Nov 15 '05 #2
Thank you everyone

More questions:

What is recommended solution to build multi-language application? In
MFC, multiple resource file and corresponding DLL file was used. But
in C#, text segments seem to be hardcoded in C# source code - in
InitializeComponent as mentioned by Vijaye Raji.

Does .NET use message queue and pump to dispatch events in a main
thread? And is event similar to Windows message? or somewhat different
concept like virtual function?
In MFC, OnTimer is invoked by main thread message queue- eventually,
thread safe with only one thread. Same in C#? or is another thread
used?

Thanks again

Scott

"Vijaye Raji" <no************@hotmail.com> wrote in message news:<#U**************@TK2MSFTNGP09.phx.gbl>...
Well, although not a perfect match, here are the C# versions of MFC concepts

MainFrame: Form (that would be the main Form)
Doc/view: The wizard doesn't do this for you but you can always have this
architecture if you want.
Dialog resource file: You have everything written out to the
"InitializeComponent" method of the Form that's being designed.
CString: string
Notify Messages: You're right. They come as events.
Worker/UI threads: You set the "IsBackgroundThread" to true for worker and
false for UI (well, that's the general usage, although there's not a whole
lot of difference between the two; Background threads don't keep a process
alive without atleast one foreground thread)
ANSI/Unicode: You set the Encoding. Look up System.Text namespace
Timer: Timer. Windows Forms has a Timer component that you can add to any
Control.

Since you have plenty of experience in MFC, the samples in MSDN and the
Tutorials should be good enough to get you started off with C#.

Good luck!
-vJ
"Scott" <ba*********@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
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 => ???

Nov 15 '05 #3
Inline

-vJ

"Scott" <ba*********@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
Thank you everyone

More questions:

What is recommended solution to build multi-language application? In
MFC, multiple resource file and corresponding DLL file was used. But
in C#, text segments seem to be hardcoded in C# source code - in
InitializeComponent as mentioned by Vijaye Raji.
You set the Form's property, "Localize" to true. A resource file will be
created for all the data and will be read from there. So, when you change
languages, you localize only the resource files

Does .NET use message queue and pump to dispatch events in a main
thread? And is event similar to Windows message? or somewhat different
concept like virtual function?
Events are very high level wrappers. Under the hood, Windows messages still
exist.
In MFC, OnTimer is invoked by main thread message queue- eventually,
thread safe with only one thread. Same in C#? or is another thread
used?
I'm not sure about this one... but I'd hazard a guess that the same WM_TIMER
message is being used in C#.
Thanks again

Scott

"Vijaye Raji" <no************@hotmail.com> wrote in message

news:<#U**************@TK2MSFTNGP09.phx.gbl>...
Well, although not a perfect match, here are the C# versions of MFC concepts
MainFrame: Form (that would be the main Form)
Doc/view: The wizard doesn't do this for you but you can always have this architecture if you want.
Dialog resource file: You have everything written out to the
"InitializeComponent" method of the Form that's being designed.
CString: string
Notify Messages: You're right. They come as events.
Worker/UI threads: You set the "IsBackgroundThread" to true for worker and false for UI (well, that's the general usage, although there's not a whole lot of difference between the two; Background threads don't keep a process alive without atleast one foreground thread)
ANSI/Unicode: You set the Encoding. Look up System.Text namespace
Timer: Timer. Windows Forms has a Timer component that you can add to any Control.

Since you have plenty of experience in MFC, the samples in MSDN and the
Tutorials should be good enough to get you started off with C#.

Good luck!
-vJ
"Scott" <ba*********@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
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 => ???

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: GAD | last post by:
Following our conversation here are my questions: I would like to migrate an application that runs on windows XP to PDA. I would like to use pocket PC 2003 in order to get support for VOIP My...
4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
4
by: Azhar Bilgrami | last post by:
Dear Hi: Hope to see u in good health. " I want to migrate a database which is currently running Unix as Operating System and Oracle ver 6 as Database, it is also using oracle froms version 3...
8
by: Scott | last post by:
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...
1
by: billb | last post by:
Hello all, Does anyone have any C# code to replace this working VB6 code ... when i move it to VB.NET is does not work as illustrated below. Ineed to keep the form or web form window on top...
3
by: daveboyd | last post by:
Hi! I have an MFC application that is under development in VS2003 and frankly MFC seems difficult to use and poorly documented -- I frequently find the only way to get example code is on the...
1
by: garethdjames | last post by:
I work for a large organisation where we use .Net 1.1 as our sole development language. We have many frameworks and applications and web sites that are developed in .Net 1.1 These...
1
by: Bonggoy Cruz | last post by:
We have a fairly big size ASP.NET web application that was written VB.NET. We are in the process converting the web project. We used the migration wizard included in VS 2005. I followed step by...
0
by: jsmith | last post by:
hi all i use delphi for win32 applications and C for microcontrollers. i going to migrate to C for windows (and linux soon), while developing from win32 to DotNet. there are several compilers...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.