473,406 Members | 2,549 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,406 software developers and data experts.

GUI programming, MFC and C#

Hello,

Could someone please tell me the history of GUI programming for
windows. In the early days, we had to write 100s of lines of code to
make a simple dialog box. Then along came MFC to simplify things. And
now, finally we have visual C#.NET.
Is that right? Is there anything else to it? Can someone please guide
me to some link form where I can get to know how things evolved from
pre-MFC to MFC to where we are now.
Now...here is my problem....I have an application which was made years
back. Its GUI has been written using MFC. Now I need to make some
changes and make a newer verison of it. But for that I will have to
teach myself MFC (I am familiar with C#). The only advantage of using
MFC is that MUCH of the earlier code will be reused. Is there any way
to get around this? I really wish I could write the GUI in C# and still
reuse the code of the precious stuff.

Thanks
Siddharth

Nov 17 '05 #1
3 1984
With Avalon there will be XAML :P Then you can script GUI in WinForms as you would do with a WebPage.
On Fri, 27 May 2005 13:59:50 +0200, Siddharth Jain <si**************@rediffmail.com> wrote:
Hello,

Could someone please tell me the history of GUI programming for
windows. In the early days, we had to write 100s of lines of code to
make a simple dialog box. Then along came MFC to simplify things. And
now, finally we have visual C#.NET.
Is that right? Is there anything else to it? Can someone please guide
me to some link form where I can get to know how things evolved from
pre-MFC to MFC to where we are now.
Now...here is my problem....I have an application which was made years
back. Its GUI has been written using MFC. Now I need to make some
changes and make a newer verison of it. But for that I will have to
teach myself MFC (I am familiar with C#). The only advantage of using
MFC is that MUCH of the earlier code will be reused. Is there any way
to get around this? I really wish I could write the GUI in C# and still
reuse the code of the precious stuff.

Thanks
Siddharth


--
Happy coding!
Morten Wennevik [C# MVP]
Nov 17 '05 #2
Hello Siddharth,

Not sure how the history will help you.
Xerox PARC came up with the fundamental ideas of the overlapping window.
Apple lept on the idea with the LISA and then the Mac, creating a great deal
of interest. A number of systems appeared for the DOS platform that
provided window-style views, which led to Microsoft developing a number of
iterations of a product called Windows that didn't take off until Windows
3.0 came out.

At that point, C was the language of choice and there were only a few
"controls" that were native to the system.
(I wrote one or two C apps to use the first windows interface... it wasn't
easy).

As Microsoft made the transition to C++, some other folks suggested that the
way to open up GUI development was to provide visual designers. The first
successful one was Visual Basic. So, around the time that C++ and MFC were
getting up steam, VB presented millions of folks with a way to develop GUI
apps without writing in either C or C++. Delphi, Powerbuilder, and others
took this direction to new heights, and many pre-existing languages like
FoxPro added GUI capabilities and took them in new directions.

Microsoft added visual designers to C++ through Visual Studio using MFC.
Microsoft also pursued the COM architecture and made it trivial to create
COM apps in Visual Basic. (It took a bit more work to do COM in C++).

Then the Internet came along. Microsoft jumped in with both feet, but it
took the invention of Java to really shake things up. Java understood the
web inherently, and was small and fast to download. Microsoft came out
first with ATL, and then jumped on the Java bandwagon. At one time,
Microsoft's JVM was the fastest one available.

Microsoft saw the advantages and disadvantages of Java and hired some of the
current "bright lights" of programming language development to come to
Redmond. They began working on Microsoft's next generation of languages
based on the strengths of Java but closer to C++ in style. Then SUN sued,
and put Microsoft out of the Java business.

Around the same time, Microsoft's efforts came to fruit, and MS put out the
..Net framework along with C# and VB.Net and partners that delivered dozens
of additional languages. Java is still strong. My personal opinion is that
C# is quite strong as well. SUN created a fierce competitor when it decided
to kick MS out of the Java game. Only time will tell which will ultimately
become a de-facto standard.

Now, on to your real problem: None of that matters. You have an app that
uses MFC. MFC has no descendents. There is no easy transition from MFC to
anything.

Depending on the size of your app, you could go one of two ways (a1-a4) or
(b):

a1) become or hire an MFC and COM expert.
a2) Seperate your existing app so that the business logic is different from
the GUI code.
a3) Put the Business object into COM components that your GUI code calls.
a4) Then write a new GUI in C# to call the former systems' business logic.

b) start over in C#.

The size and complexity of your app will dictate the direction you should
take. You may want to outsource (a1-a3) (see RentACoder.Com) and see what
comes back. That would give you the ability to do (a4) yourself. You will
still need to know COM and MFC to add any new business functionality, but it
is a lot easier than starting over and you are less likely to introduce
defects. Regression testing is easier as well because, at some point, you
can have a C# app and a C++ app side by side and you can see, for yourself,
if your new GUI does the exact same things as the old GUI does.

Hope that helps,

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Siddharth Jain" <si**************@rediffmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hello,

Could someone please tell me the history of GUI programming for
windows. In the early days, we had to write 100s of lines of code to
make a simple dialog box. Then along came MFC to simplify things. And
now, finally we have visual C#.NET.
Is that right? Is there anything else to it? Can someone please guide
me to some link form where I can get to know how things evolved from
pre-MFC to MFC to where we are now.
Now...here is my problem....I have an application which was made years
back. Its GUI has been written using MFC. Now I need to make some
changes and make a newer verison of it. But for that I will have to
teach myself MFC (I am familiar with C#). The only advantage of using
MFC is that MUCH of the earlier code will be reused. Is there any way
to get around this? I really wish I could write the GUI in C# and still
reuse the code of the precious stuff.

Thanks
Siddharth

Nov 17 '05 #3
Thanks Nick, that really helped.

Nick Malik [Microsoft] wrote:
Hello Siddharth,

Not sure how the history will help you.
Xerox PARC came up with the fundamental ideas of the overlapping window.
Apple lept on the idea with the LISA and then the Mac, creating a great deal
of interest. A number of systems appeared for the DOS platform that
provided window-style views, which led to Microsoft developing a number of
iterations of a product called Windows that didn't take off until Windows
3.0 came out.

At that point, C was the language of choice and there were only a few
"controls" that were native to the system.
(I wrote one or two C apps to use the first windows interface... it wasn't
easy).

As Microsoft made the transition to C++, some other folks suggested that the
way to open up GUI development was to provide visual designers. The first
successful one was Visual Basic. So, around the time that C++ and MFC were
getting up steam, VB presented millions of folks with a way to develop GUI
apps without writing in either C or C++. Delphi, Powerbuilder, and others
took this direction to new heights, and many pre-existing languages like
FoxPro added GUI capabilities and took them in new directions.

Microsoft added visual designers to C++ through Visual Studio using MFC.
Microsoft also pursued the COM architecture and made it trivial to create
COM apps in Visual Basic. (It took a bit more work to do COM in C++).

Then the Internet came along. Microsoft jumped in with both feet, but it
took the invention of Java to really shake things up. Java understood the
web inherently, and was small and fast to download. Microsoft came out
first with ATL, and then jumped on the Java bandwagon. At one time,
Microsoft's JVM was the fastest one available.

Microsoft saw the advantages and disadvantages of Java and hired some of the
current "bright lights" of programming language development to come to
Redmond. They began working on Microsoft's next generation of languages
based on the strengths of Java but closer to C++ in style. Then SUN sued,
and put Microsoft out of the Java business.

Around the same time, Microsoft's efforts came to fruit, and MS put out the
.Net framework along with C# and VB.Net and partners that delivered dozens
of additional languages. Java is still strong. My personal opinion is that
C# is quite strong as well. SUN created a fierce competitor when it decided
to kick MS out of the Java game. Only time will tell which will ultimately
become a de-facto standard.

Now, on to your real problem: None of that matters. You have an app that
uses MFC. MFC has no descendents. There is no easy transition from MFC to
anything.

Depending on the size of your app, you could go one of two ways (a1-a4) or
(b):

a1) become or hire an MFC and COM expert.
a2) Seperate your existing app so that the business logic is different from
the GUI code.
a3) Put the Business object into COM components that your GUI code calls.
a4) Then write a new GUI in C# to call the former systems' business logic.

b) start over in C#.

The size and complexity of your app will dictate the direction you should
take. You may want to outsource (a1-a3) (see RentACoder.Com) and see what
comes back. That would give you the ability to do (a4) yourself. You will
still need to know COM and MFC to add any new business functionality, but it
is a lot easier than starting over and you are less likely to introduce
defects. Regression testing is easier as well because, at some point, you
can have a C# app and a C++ app side by side and you can see, for yourself,
if your new GUI does the exact same things as the old GUI does.

Hope that helps,

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Siddharth Jain" <si**************@rediffmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hello,

Could someone please tell me the history of GUI programming for
windows. In the early days, we had to write 100s of lines of code to
make a simple dialog box. Then along came MFC to simplify things. And
now, finally we have visual C#.NET.
Is that right? Is there anything else to it? Can someone please guide
me to some link form where I can get to know how things evolved from
pre-MFC to MFC to where we are now.
Now...here is my problem....I have an application which was made years
back. Its GUI has been written using MFC. Now I need to make some
changes and make a newer verison of it. But for that I will have to
teach myself MFC (I am familiar with C#). The only advantage of using
MFC is that MUCH of the earlier code will be reused. Is there any way
to get around this? I really wish I could write the GUI in C# and still
reuse the code of the precious stuff.

Thanks
Siddharth


Nov 17 '05 #4

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

Similar topics

12
by: G. | last post by:
Hi all, During my degree, BEng (Hons) Electronics and Communications Engineering, we did C programming every year, but I never kept it up, as I had no interest and didn't see the point. But now...
3
by: user | last post by:
Hi all, At the outset, I regret having to post this slightly OT post here. However, I strongly feel that people in this group would be the best to advise me on my predicament. I am working as...
7
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already...
30
by: Jakle | last post by:
I have been googling, but can seem to find out about C GUI libraries. My main platform is Windows, but it would be nice to find a cross platform library. I've been programming with php, which...
111
by: Enteng | last post by:
Hi I'm thinking about learning C as my first programming language. Would you recommend it? Also how do you suggest that I learn it?What books/tutorials should I read for someone like me? Thanks...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.