windows - Prerequisites for learning MFC programming -


i know bit of c++ , c , project working whole lot of mfc programming. can experienced tell me prerequisites learning mfc.

also, best sources learn ?

any particular book or video series?

i know question general answers might me(or else digging mfc) lot

thanks!

+1 question!

tl;dr: learn win32 - in order.

by far important prerequisite mfc solid understanding of windows api (also referred win32 api). need familiar few key concepts of c++ , intimate tools. proposed list of prerequisites be:

  1. get solid background in windows api development.
  2. familiarize relevant concepts of c++.
  3. learn tools.

the following rundown of these steps, links additional information.

1. windows api:

the windows api exposes services through c interface. consequence resource management tedious boiler plate code. , visible in source code (sometimes incredible bonus when reading code). mfc - large extent - automated resource management wrapper (and utility library) around windows api, hiding of resource management , type conversions. fluent in mfc have understand hides.

to started windows api , need quick rundown of major components recommend theforger's win32 api tutorial (by forgey of #winprog fame). covers message handling, windowing, controls, , gdi, , builds solid foundation. if feel investing (well spent) time exploring windows api in more detail, best resource date still charles petzold's programming windows (not confused managed petzold). msdn resource both overview detailed documentation specific areas like:

2. key c++ concepts:

mfc implemented in terms of c++. while predates official c++ standard won't find funky business in there. little template code , none of new-fangled c++11 features. intimacy basic c++ concepts long way.

as mentioned previously, mfc large extent resource management wrapper around windows api. there direct mapping between windows api resources , mfc objects (like hwnd : cwnd, or hdc : cdc). if understand constructors, destructors , object lifetime you're pretty set in department.

when using mfc's template-based containers (like cmap) exposed templates, naturally. nothing involved there, basic type parameterization reuse container code , enable type-safe element access. introduction mfc containers can found here: collections.

exceptions used in mfc, when accessing files or when serializing data. should still know how write exception safe code; see exceptions in non-trivial applications. overview can found @ exception handling in mfc.

one area not part of c++ used extensively throughout mfc preprocessor. regardless of how trivial mfc application is, there macros. have have understanding of both preprocessor syntax how preprocessor operates.

3. tools:

while possible write mfc applications notepad alone not efficient so. plain text editor might idea learning platform, when comes time meet milestones , deadlines want use powerful ide.

mfc pretty implies use of visual studio , assume that's you're using. if using vs6 or vs2010 (or later) have access mfc class wizard. tool using frequently. safely operate must familiar code generates you. play around it, inspect generated code, , try build mental model of it. if doesn't make sense yet should return later.

the mfc class wizard generate preprocessor code. hides tremendous amount of complexity need understand use safely. use ide navigate through preprocessor macros, try expand them in mind, , see if understand resulting code. if having difficulty unmangling macro invocations have compiler output preprocessed code using /p (preprocess file) compiler option.

occasionally have or debug mfc source code. make source code available source browsing , debugger have set vc++ directories include following (if not present):

$(vcinstalldir)atlmfc\src\mfc $(vcinstalldir)atlmfc\src\mfcm $(vcinstalldir)atlmfc\src\atl 

depending on ide either done through tools -> options: projects , solutions -> vc++ directories or property sheet of project settings.

finding help: while msdn best resource documentation, mfc section feels in maintenance mode , doesn't attention windows api documentation. if find mfc documentation lacking respective windows api documentation instead, example cwnd::onncdestroy vs. wm_ncdestroy. latter contains valuable information on order in windows receive message.

learning mfc

a comprehensive resource learning mfc jeff prosise' programming windows mfc. while dated (released in 1999) concepts still valid today. provides overview of concepts of mfc , goes deep implementation details. if find struggling generated (preprocessor) code book you.

as valuable online resource msdn offers information on aspect of mfc development. major concepts include:

a full list can found @ concepts.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -