By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,314 Members | 1,772 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,314 IT Pros & Developers. It's quick & easy.

What 's the difference between win32 app and MFC

P: n/a
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
Share this Question
Share on Google+
8 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a

"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.