473,394 Members | 1,759 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,394 software developers and data experts.

What 's the difference between win32 app and MFC

Hello!

I just wonder what the difference is between a native win32-app and MFC.

What I know is that you can use Win32 API in both cases.

I think an MFC application is connected with a GUI which a win32 is not. You
may correct me if I'm wrong on this point.

//Tony

Nov 17 '05 #1
8 4739
Tony Johansson wrote:
Hello!

I just wonder what the difference is between a native win32-app and MFC.

What I know is that you can use Win32 API in both cases.

I think an MFC application is connected with a GUI which a win32 is not. You
may correct me if I'm wrong on this point.

//Tony


Tony:

A Win32 application can either be a Console Application (no GUI) or a
Windows application (GUI).

A Win32 console application runs in a command window and typically does
not use MFC, because most of MFC is GUI-related. A carefully written
console application will compile and run on other systems (e.g. linux
using the gcc compiler).

A Win32 Windows application can be written entirely in the Win32 API, or
it can use MFC. If you want to see how to write Windows applications
without MFC (and without any wizards) look at the book "Programming
Windows 95" by Charles Petzold.

HTH,

David Wilkinson
Nov 17 '05 #2
Hello!!

You wrote the following
A Win32 Windows application can be written entirely in the Win32 API, or
it can use MFC.

I just wonder is it possible to mix both use win32 API and MFC in a win32
application am I right?
Or do you have to chose either of these two alternatives?
//Tony
"David Wilkinson" <no******@effisols.com> skrev i meddelandet
news:eQ**************@TK2MSFTNGP09.phx.gbl...
Tony Johansson wrote:
Hello!

I just wonder what the difference is between a native win32-app and MFC.

What I know is that you can use Win32 API in both cases.

I think an MFC application is connected with a GUI which a win32 is not.
You may correct me if I'm wrong on this point.

//Tony


Tony:

A Win32 application can either be a Console Application (no GUI) or a
Windows application (GUI).

A Win32 console application runs in a command window and typically does
not use MFC, because most of MFC is GUI-related. A carefully written
console application will compile and run on other systems (e.g. linux
using the gcc compiler).

A Win32 Windows application can be written entirely in the Win32 API, or
it can use MFC. If you want to see how to write Windows applications
without MFC (and without any wizards) look at the book "Programming
Windows 95" by Charles Petzold.

HTH,

David Wilkinson

Nov 17 '05 #3
Tony Johansson wrote:
Hello!!

You wrote the following
A Win32 Windows application can be written entirely in the Win32 API, or
it can use MFC.

I just wonder is it possible to mix both use win32 API and MFC in a win32
application am I right?
Or do you have to chose either of these two alternatives?


Tony:

If you do not use the wizard to create your project, there is really no
difference between a Win32 project and an MFC project. You just include
the headers you want and write your code. An MFC project creates a
native Win32 executable, just as does a Win32 project written without MFC.

If you generate a "Win32 project" using the wizard, then you have to
write your own WinMain function. If you select "MFC project" then the
WinMain is provided for you.

Although purists might say otherwise, there is really no reason not to
use MFC to write native Win32 applications. It just makes life so much
easier.

David Wilkinson

Nov 17 '05 #4
Hello!

You say the following

Although purists might say otherwise, there is really no reason not to
use MFC to write native Win32 applications. It just makes life so much
easier.

Why is it easier?
Will you have access to the GUI editor when choosing the MFC wizard as well
as in choosing the win32 application?

//Tony

"David Wilkinson" <no******@effisols.com> skrev i meddelandet
news:%2****************@TK2MSFTNGP09.phx.gbl...
Tony Johansson wrote:
Hello!!

You wrote the following
A Win32 Windows application can be written entirely in the Win32 API, or
it can use MFC.

I just wonder is it possible to mix both use win32 API and MFC in a win32
application am I right?
Or do you have to chose either of these two alternatives?


Tony:

If you do not use the wizard to create your project, there is really no
difference between a Win32 project and an MFC project. You just include
the headers you want and write your code. An MFC project creates a native
Win32 executable, just as does a Win32 project written without MFC.

If you generate a "Win32 project" using the wizard, then you have to write
your own WinMain function. If you select "MFC project" then the WinMain is
provided for you.

Although purists might say otherwise, there is really no reason not to use
MFC to write native Win32 applications. It just makes life so much easier.

David Wilkinson

Nov 17 '05 #5
On Sat, 22 Oct 2005 15:50:05 GMT, Tony Johansson wrote:
I just wonder what the difference is between a native win32-app and MFC.


Frankly, I guess the word here is dependency. If you write your app as
an MFC app, then you become dependent upon the presence of the MFC
DLLs. Dependency isn't that big of a deal : after all, (classic) VB
apps have been dependent upon a honking great DLL for years without
anyone other than download-sensitive shareware folks being that
bothered, and the MFC runtime DLLs are on every windows machine AFAIK
(but not the debug ones).

I haven't written a native Win32 api in years - MFC makes it much
easier, and the downside is so footling as to be meaningless, really.
--
Bob Moore
http://bobmoore.mvps.org/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Nov 17 '05 #6
"Tony Johansson" <jo*****************@telia.com> wrote in message
news:OU*********************@newsc.telia.net...
You say the following

Although purists might say otherwise, there is really no reason not to
use MFC to write native Win32 applications. It just makes life so much
easier.

Why is it easier?


Well, like any class library MFC does _stuff_. If you understand what it
does, and if what it does is what you want to do, then there is less code
for you to write.

For example, if your application fits int MFC's "mold" you can get print
preview support for free.

Regards,
Will
Nov 17 '05 #7

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

I just wonder what the difference is between a native win32-app and MFC.

What I know is that you can use Win32 API in both cases.

I think an MFC application is connected with a GUI which a win32 is not.
You may correct me if I'm wrong on this point.


MFC is a library of C++ classes that give a more object-oriented view of the
Win32 API. Many of the MFC classes are little more than OO wrappers on top
of Win32 (e.g CWnd just wraps all of the window functions from Win32 into a
class, and provides some helper facilities for making it easier to deal with
window messages, etc).

MFC also provides facilities such as a document-view architecture that are
not part of the Win32 API, and other utility code (collection classes,
string class, etc) that you might otherwise write yourself, or get from
elsewhere (e.g the C++ standard library, which didn't exist when MFC was
first created).

-cd
Nov 17 '05 #8
Hi Tony,

In addition to what others have said, and perhaps in a different way, MFC
applications are Win32 API applications. The nice thing about C++ in
general (and most OOP languages) is that it allows you to build layers of
abstraction. MFC is a very thin layer on top of the Win API that builds
applications on top of a framework or foundation (thus the name Microsoft
Foundation Classes). As others have said, a lot depends on the type of
program you are writing, but I've done all kinds of programs with MFC
(although to be fair I mostly use it for desktop applications that have
menus and toolbars and dialogs and such).

Tom

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

I just wonder what the difference is between a native win32-app and MFC.

What I know is that you can use Win32 API in both cases.

I think an MFC application is connected with a GUI which a win32 is not.
You may correct me if I'm wrong on this point.

//Tony

Nov 17 '05 #9

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

Similar topics

15
by: Arie Kanarie | last post by:
Hello, I want to start with learning VB for my work. I'm a Industrial Automation engineer and i want to know what the difference is between VB6 and VB.NET. Is VB.NET just an anaother word for...
1
by: DrDevious | last post by:
Maybe I am doing something wrong but has anyone else here noticed a difference in the positioning of text between the Graphics.DrawString method and the Win32 GDI DrawText function? My text is...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
2
by: Lokicer | last post by:
Hi I note there are two functions putch() and _putch() in VC++ Library. Which one should be used under specified situation. What is the difference between putch() and _putch()? Thanks!
51
by: jacob navia | last post by:
I would like to add at the beginning of the C tutorial I am writing a short blurb about what "types" are. I came up with the following text. Please can you comment? Did I miss something? Is...
17
by: ilPostino | last post by:
Hey, My experience with c++ is limited to ATL and for the past 3 years it's just been c#. I need to write a UI intensive application that is just too slow in managed code. So I'm re-doing it in...
8
by: cmay | last post by:
I am looking for something to help me with documenting / planning / designing my asp.net applications. Once in a while I try doing some UML in Visio, but it really feels like overkill, espically...
3
by: DaTurk | last post by:
Hi, I'm implementing the Idisposable pattern and am wondering what the difference it between managed, and unmanaged resources? http://msdn2.microsoft.com/en-us/library/fs2xkftw.aspx in the...
9
by: =?Utf-8?B?S3VlaXNoaW9uZyBUdQ==?= | last post by:
What is the difference between the regular VC++ edition and the VC++ express edition? If there is not too much difference in functionality, why the express edition is free?
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.