Jump to content
  • Advertisement

Archived

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

d000hg

What exactly is MFC?

This topic is 5816 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

All I know about MFC is it provides a nicer way to be notified of messages - you supply a function to be called, and that it's very good for complicated dialogs. Why and how is it better for complicated window control setups, do you have to radically alter all code to use it or just the initialisation stuff? Oh also I got the impression you didn't need a complicated callback function for every button/text input thingy. Is this true? Does standard windows (MSVC++) support an easy way of linking controls to functions ie will it automatically generate an empty function for me (like in JBuilder)? John 3:16 [edited by - d000hg on July 16, 2002 3:41:56 PM]

Share this post


Link to post
Share on other sites
Advertisement
Google is still your friend, as is MSDN. MFC is a framework that abstracts you from Win32 API and simplifies common programming tasks, see the links for more info.

---
Come to #directxdev IRC channel on AfterNET

Share this post


Link to post
Share on other sites
Claimed to be Microsoft Foundation Class, but most of the time, it is Microsoft Fustration Class. It contains loads of odd preprocessing #defines plus, a function call made in MFC might means thousands line of code being executed. And if you are trying to have MFC work your way (instead of having you to work the MFC way)... then it is like using a Pirate Lego set to create a nice sport car set. I can't imagine how Mr. Hook drives the car - you know, it is not easy to steer the car with a hook, and accelerate the car with a wooden 'leg'.

[edited by - DerekSaw on July 16, 2002 9:20:04 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by d000hg
...Does standard windows (MSVC++) support an easy way of linking controls to functions ie will it automatically generate an empty function for me (like in JBuilder)?


I think Borland C++Builder serves you best in this case.

Share this post


Link to post
Share on other sites
quote:
Original post by DerekSaw
Claimed to be Microsoft Foundation Class, but most of the time, it is Microsoft Fustration Class.


with the current msdn documenation, technical notes, and widely available source code you can only be frustrated if you don''t know how to search. mfc is frustrating sometimes, but far less often that you''re making it out to be.
quote:

It contains loads of odd preprocessing #defines


you''d be surprised how much preprocessor stlport, or any general-purpose library, has. learn to read the preprocessor. browse information greatly helps in this respect.
quote:

plus, a function call made in MFC might means thousands line of code being executed.


yadda yadda. mfc''s overhead is nowhere near this big. and you''re forgetting all the nice things that mfc does so that you can write five lines of code instead of a thousand it would take you to implement equivalent functionality in plain win32.
quote:

And if you are trying to have MFC work your way (instead of having you to work the MFC way)... then it is like using a Pirate Lego set to create a nice sport car set. I can''t imagine how Mr. Hook drives the car - you know, it is not easy to steer the car with a hook, and accelerate the car with a wooden ''leg''.


read the docs, resources, and code samples. see the point on frustration above. mfc is easy to use if you know where to fund information, and there is an incredible amount of information available.

is mfc overkill for a tutorial app? maybe. was it designed for writing games? probably not. however, it''s nowhere near as bad as you''re describing it. many tedious tasks in win32 are made very easy by mfc. it certainly does a pretty good job at what it was designed for -- providing a fairly high level win32 wrapper. i suspect you just don''t have an in-depth knowledge of it, and are speaking of ignorance.

did i mention that Windows Template Library does a lot of what mfc does and is much cleaner? play with it if you''re not afraid of the source.

---
Come to #directxdev IRC channel on AfterNET

Share this post


Link to post
Share on other sites
quote:
Original post by null_pointer
MFC is a program that mangles source code.


dumbest thing I''ve heard all day

Share this post


Link to post
Share on other sites
Here''s a little advice. Do NOT discount MFC without using it. I did that for a couple of years, thinking it was crap. But I just recently started using it at my internship about a month ago. Using the classwizard, you can do things very easily and quickly. Complex Windows programs (multidocument windows, big dialog boxes, etc.) become very simple. A lot of people foolishly say it sucks without knowing a thing about it, I know because I use to be one of them. But now I will reach for MFC if I want to simplify a program and make my life easier. Gosh this sounds like an infomercial. Anyways, just try it.

Share this post


Link to post
Share on other sites
niyaw, that''s my feeling about MFC anyway. I don''t feel good when looking at those similar BEGIN_MESSAGE_MAP(), END_MESSAGE_MAP, TRY/CATCH/THROW.

quote:
Original post by BitBlt
Here''s a little advice. Do NOT discount MFC without using it. I did that for a couple of years, thinking it was crap. But I just recently started using it at my internship about a month ago. Using the classwizard, you can do things very easily and quickly. Complex Windows programs (multidocument windows, big dialog boxes, etc.) become very simple. A lot of people foolishly say it sucks without knowing a thing about it, I know because I use to be one of them. But now I will reach for MFC if I want to simplify a program and make my life easier. Gosh this sounds like an infomercial. Anyways, just try it.

I''ve used it before (even that time they don''t even have ClassWizard, but a lousy Programmer WorkBench ) and I''m still using it now. And yes... it was easy, when you do it ''their'' way. Anyway, I would anytime prefer C++Builder VCL to MFC because the former is way lot faster (read: RAD).

IMHO, using application framework (eg. MFC, OWL, VCL) is not a good way learn Windows programming from the start.

Share this post


Link to post
Share on other sites
It''s not perfect, but 90% of the time that I see people say

MFC is bad because ______________

it''s either based on misinformation and/or misuse on their part.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!