472,365 Members | 1,231 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,365 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 4629
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: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.