Advertisement

MFC

Started by February 16, 2003 02:35 PM
7 comments, last by tfinazzi 21 years, 9 months ago
What would you say, is MFC worth learning? I have never created a window or something like that yet, so i don''t know if it is much harder to do without MFC. Is MFC necessary, or just helpful?
helpful.
Advertisement
Hi tfinazzi,
I had the same problem when i was a newbie. I had the choice between pure Win32 or MFC. Well it all depends on what you plan to do with your programming skills. If you only wish to create Games and small GUI tools then Win32 is the way to go ... as you dont have the extra Overhead that MFC does. If you wish to create complex programs, with multiple windows and dialog boxes, then i suggest MFC, as it often simplifies the work. Also MFC is An Object-Oriented api, so will need a good knowledge on C++ classes.

The Path I took, was to learn MFC ... get a good knowledge. Then start to learn Game Developement. Seeing as you dont need a large amount of Win32 code, to get it going ... it isnt very neccecary to buy a large book to learn pure win32, if all you need it for is to initiate the window, and check for messages. Then again if yuor a C programmer and wish to do everything in pure Win32 then i do suggest a book , but either way. If you learn MFC or pure Win32 first, it is easy to change to one another.

I do believe there are other API librarys that you can also use to create windows, but its your choice.

I hope this helps guide you on your way to creating your first window. Try looking at simple window tutorials for both MFC and Pure win32, and see which one you prefer.

The choice is yoursssss!

-----
Losec
-----
I''m sure MFC is really helpful when you start learning C++ with it.
I learned the "normal" C++ in the console and now I''ve real problems to understand the stuff VC6 writes into the files when I start an MFC app.

But hey, isn''t it most important that it works and not what it looks like ?
Ah, to MFC or not to MFC, that is the question... (Clears throat) sorry.

Back in the day when OWL an MFC where bitterly discussed in pretty much every programming journal/magazine I originally thought that Borland’s (now Imprise) OWL was the better framework. Some 5 or so years of using MFC later I’m a slave to it.

But, there is good news, WTL. WTL, the Windows Template Library, is a much simpler approach to windows programming – and Microsoft wrote it, you just won’t hear much about it because they want you to use .NET, but that is another story.

Here are some links to WTL sites:
WTL31.exe This is the installation for WTL.

WTL info at Code Project


The thing that I like about WTL is that since you are coding your engine around the Win32 API (Using WinMain()) along with OpenGL and/or DirectX, your tools don’t need to be written behind some blind messaging scheme that MFC seems to have. With WTL you “sort of” know where the messages are coming from – because you code the handlers. In MFC, you click this handle this message and edit some code – to VBish for me. But, back to my intended point. With WTL, you can easily drop your games engine into an application without much re-work. With MFC, you have to “figure” lots of things out – usually through PreProcessMessage’s; yuck.

If you’re still here – check this out : A WTL Game Loop.





Dave "Dak Lozar" Loeser
Dave Dak Lozar Loeser
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."--anonymous
WTL 7 is out
Advertisement
It may be helpful in that it can speed up game tool development, but as far as using it for game programing, No.
and that is based on what extensive comparison of pros and cons of mfc (i'm sure you weren't referring to wtl, were you?) for game development?


[edited by - niyaw on February 17, 2003 8:53:55 PM]
I use MFC in mine. I used it to create the configuration dialogs and target window. I don't think it gets in the way of the game/engine at all in terms of performance. With that said, I really recommend MFC if you're expecting to do similar things. But don't depend on the appwizards once you learn it, the templates usually get in my way, and you'll probably feel the same. I recommend you start with Win32 API while you learn C++. Then start learning MFC when you feel pretty strongly about both.

You'll find a lot of commercial games using it as well. One of my favorites, Max Payne, is a good example. The reason Remedy used MFC is obvious, they have a lot of stuff there. If you're going to be making something with just one simple window, there's probably no need for MFC. You should at this point have some sort of framework or base code you can start with for your next project, anyhow. Anyway, at this point, it's up to you to weigh MFC for your next project. Hope this helps any.

EDIT:

Also, MFC isn't the only toolkit out there. Check out Qt, VCL, Gtk+, and even Windows Forms from MS's .NET Framework (will require VS.NET/VC++.NET for managed code). The last I'd probably agree won't provide top performance, but then again, it's not entirely necessary for GUI to run lightspeed. If it helps develop, then it will most likely outweigh its performance issues. But the requirements for users are not yet realistic (most people don't have it, and won't want the Framework atm).

[edited by - aggregate on February 17, 2003 9:05:29 PM]

This topic is closed to new replies.

Advertisement