Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

savagerx

Which is better? WIN32 or MFC

This topic is 6021 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

It seems that nowadays more and more developers are going for MFC and otherwise for WIN32. Is it that WIN32 is becoming outdated?

Share this post


Link to post
Share on other sites
Advertisement
The problem with MFC is code bloat.. you suddenly find yourself including the kitchen sink when all you wanted to model was the dishcloth.

If you want a lean mean piece of code, WIN32 is the way to go.. but these days with lots of system memory, lots of disk space and big pressures to produce content fast - programmers get lazy.They think why invent the wheel even though the car gets thrown in too.

The disadvantage is working through microsoft''s entangled MFC API. Great if you want to do something common, but the API isnt flexible enough if you want to push an envelope.

Thats my experience anyhow.

Share this post


Link to post
Share on other sites
MFC is merely a Win32 wrapper. Do the logic from there.

MFC is convenient, but it''s showing its age. Also, since C++ has matured a lot since MFC inception a lot of the workarounds and emulated features have been better implemented in the language itself. The logical successor to MFC is the Windows Template L ibrary (WTL), except that Microsoft released that baby as a completely undocumented and unsupported collection of template source files and an MSVC AppWizard. The Code Project hosts an effort to document this much better structured API, and are meeting with some success.

However, (and you knew this was coming) Microsoft seem to have neither interest nor reason for interest in further Win32 API GUI development. The introduction of GDI+ and WinForms could possibly signal the end of MFC/WTL, provided there are means for dynamically creating WinForms objects at runtime in code.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! | Asking Smart Questions | Internet Acronyms ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
Win32 is generally better if you want to make games, but MFC is better if you're working on a deadline or making a strictly windows GUI based program. I would reccomend learning MFC because so many employers want you to, plus it's a good way to become truly proficcent in using classes to the fullest.

Pros:
-MFC will prevent a lot of the mistakes that can happen when programming Win32 (ex. Releasing bitmaps is done automatcally)
-Large MFC applications will use around one third of the number of lines of code you write in the Win32 equivalent.

Cons:
-Can be very hard to follow (because of heavy inheritence)
-MFC is a layer on top of Win32, thus it generally runs 'slightly' slower, and takes up 'slightly' more space.

Learn it, there is no reason to neglect learning something new.

[edited by - Mulligan on April 18, 2002 2:31:30 PM]

Share this post


Link to post
Share on other sites
May be I''m still new to Windows Programming but is it true that WIN32 is the main engine that powers the Windows OS? and now, what we have are two ways of programming for Windows.






The road may be long, wind may be rough. But with a will at heart, all shall begone. ~savage chant

Share this post


Link to post
Share on other sites
More developers are going for MFC? Where did you hear that? I can''t believe a Game developer would even consider MFC.

Share this post


Link to post
Share on other sites
quote:
Original post by Mulligan
I would reccomend learning MFC because... it''s a good way to become truly proficcent in using classes to the fullest.

Um, no.

MFC requires way to much inheritance, and inheritance is generally overused (so says Herb Sutter, so you should listen). It also uses a bunch of very dirty macro methods to bind Windows messages to class methods (AFX_MESSAGEMAP_BEGIN, AFX_MESSAGEMAP_END). While WTL is cleaner and better structure, it too uses these macros.

quote:

MFC will prevent a lot of the mistakes that can happen when programming Win32 (ex. Releasing bitmaps is done automatcally)

Using an auto pointer-esque container will handle this. Simply write one for Win32 HANDLEs/GDIOBJs. ATL already provides CComPtr and CComQIPtr, so I no longer release COM interfaces (e.g. DirectX) manually. Ever.

quote:

Large MFC applications will use around one third of the number of lines of code you write in the Win32 equivalent.

True. And this is the reason why MFC is so popular. In one case I heard of, a procedure that required over 100 lines of code in "naked" Win32 was accomplished in one MFC function call.

quote:

Learn it, there is no reason to neglect learning something new.

I''d say be familiar with it. I''d also advcate WTL as a "better MFC".

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
quote:
Original post by savagerx
May be I''m still new to Windows Programming but is it true that WIN32 is the main engine that powers the Windows OS?

Not exactly. Win32 is an extensible collection of header files and libraries (static and dynamic) for programming the Windows OS. The OS itself is partly written in Win32, but lower level stuff is just written in C and C++ (and assembly).

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
although i am somewwhat inexperienced with MFC, i like it because its already object oriented. the win32 api is C-e, so you often end up writting your own wrappers and things. with MFC, you can just use a tad of composition here and there, and your windows engine is there, done, and fits nicely into your system.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!