why use MFC?

Started by
22 comments, last by Gecko 24 years, 2 months ago
what are the benefits of MFC? would it be worth it to learn MFC? i really just want some info on it and why people use it as opposed to just straight C++. thanks
_________________Gecko___

_________________Gecko___Gecko Design
Advertisement
If you were to use "straight C++" (or C), you''d have to access the Win32 API directly. What MFC does for you is to hide all of the Win32 API''s complexity, wrapping it all into classes, macros, and millions of other things. With an MFC program you no longer see or deal with the message pump code, nor do you process WM_* messages directly. Instead, you use methods. Subclassing controls is very easy with MFC. Also, the ClassWizard is hard-wired for MFC, and you can do some serious framework coding just by clicking.

Now, why use MFC? Well, I tend to think that MFC is too bloated--and just simply not necessary--for a game...at least anything real-time. If you want to write a Windows game, just use the API directly. For a game you only need a trivial amount of actual API code, and using MFC is just more of a headache than it''s worth. I''d suggest using MFC for any kind of editor you might need to make, from medium to large scale. I think that using using the API in C is the best way to go for small projects.

Personally, I think MFC is just a pain in the bottom, in most cases, but that may be just me. =)

I hope all that helped.
Personaly I don''t like MFC and don''t use it. Thought I could see some uses for it if you were trying to create a map editor or something with a drop down menu system. For the average full screen DX developer I wouldn''t use MFC it''s too ugly. As I said, that''s just my humble opinion and anyone is welcome to disagree with me.
Joseph FernaldSoftware EngineerRed Storm Entertainment.------------------------The opinions expressed are that of the person postingand not that of Red Storm Entertainment.
Don''t learn MFC until you know staight windows code. After that I would only recommend learing it for buiness apps.

note: DO NOT attempt to use it for game development, it just dosent suit the situtation.

personally, I don''t like MFC for any situation, but I guess I have never really put in the time to learn it well enough...

Hope that helped...




~Spike

You can contact me at
Luke1Howard@hotmail.com
~SpikeYou can contact me at luke_howard@dingoblue.net.au
MFC is industry standard for writing business apps and other non-DirectX/GL/whatver programs. That is a lot of level editors, tile builders, etc. use MFC. If you want a job doing standard programming MFC is good to have on your resume.

That being said, I''ve found programming standard windows programs a lot easier and less buggy using VCL in C++ Builder or Delphi from Borland. Moving from MFC to VCL was pure bliss.
Agreed with everyone else. Personally I think MFC''s pretty cool... I it heavily in Quaternion''s editors... but it isn''t really suited for in-game code.

Having said that though, some of the MFC internet connection classes (CFtpConnection) are pretty cool, and might be a viable option for adding Internet functionality to your game (downloading latest patches, etc.)






Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com
Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!
Everyone here is right....I personally love MFC for writing my level editors and windows programs....I can''t imagine coding them with anything else.MFC was a BIG pain in my backside before...but once you get to know how it works and you write a couple of programs...it becomes very easy to use.
If you want to start MFC programming,then I suggest you get this book: "MFC programming from the ground up" This book got me started in MFC and I seriously recommend it...
I too like to use MCF when doing Windows applications that uses, dialogs, buttons, menus etc. I don''t like the code classwizard generates though. It''s messy and hard to read, in my opinion.
I don''t like MFC and I don''t use it at all. When I code some kind of editor, such as level editor or windows application that uses menus, dialogs etc. I use Borland Delphi.
Delphi is cool!

Hi!
I was one of those people who learnt MFC first and got pretty confused but it all turned out well after felisandria told me how to statically link the dll files (silly me) =) MFC is great for programs with the standard Windows interface - you know the ones with the menu and toolbars....you will have a much tougher time trying to do that using Win32. Other than that, you can come up with a cool text editor with a few clicks and absolutely no coding =) Besides that, just do a few lines of code and you can come up with your own Internet browser too =) Now if you do that with pure Win32, you will find it so much more difficult. Believe me, I am trying to do a text editor now without the help of MFC and I seem to be getting very little progress (very confusing using linked list and stuff). So I hope that answers the question about the advantages of MFC in plain simple English =)

Best regards,
Sherman
_________________ Best regards, Sherman Chin Director Sherman3D (Malaysia) Sdn Bhd www.Sherman3D.com www.AlphaKimori.com

This topic is closed to new replies.

Advertisement