473,767 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2002
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.c om> 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.c om> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.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.c om> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.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
8479
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 I really want to get back into it as I see a point with GNU/Linux. I want to get my old skills back and write something or help on some projects etc. I need some good books. I used to have one called "A Book On C", but sold it,
3
2488
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 a QA in an MNC in India, since I graduated in September 2003. I am working in a QA role which requires me to do some Winrunner automation, and modifying/creating a framework in Perl for Automated Regression Testing of some command Line utilities...
7
4963
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 developed significant content for the C programming language that is available at: https://www.securecoding.cert.org/ by clicking on the "CERT C Programming Language Secure Coding Standard"
30
32259
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 has a C/C++ syntax structure, but want to move on to compliled languages. I was all ready to go with C++ and wxWindows, but I'm applying for an entry level programming possition. They use their own propriatary language, with
111
5588
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 in advance! -entengk
0
9575
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10014
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8840
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7384
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3931
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3534
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.