Jump to content

When we have to call the Base Constructor in MFC?

- - - - -

  • Please log in to reply
2 replies to this topic

#1
gaconga1105

gaconga1105

    Newbie

  • Members
  • Pip
  • 5 posts
In some examples of MFC programs, the base constructors are seldom called, ex:

in MyWnd::MyWnd()

{

   CWnd::CWnd() ;


   //...

   // some other codes

   //...

}


I wondered when should we call the base constructor (CWnd::CWnd particularly), sometime the program is crashed if i call it:confused:

Best regard,
Bim Bim

p.s: Im on my way to be a Game Developer, there are also various libraries and game engines, what should i master first, i really confused :confused: ? In my opinion, I think any of them are good, I just need to choose what I like, right??

#2
psepheroth

psepheroth

    Learning Programmer

  • Members
  • PipPipPip
  • 31 posts
Hmmm...I think they are following a certain design pattern for that.
Calling a base is rare.

#3
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 889 posts
  • Location:::1
You have to/should call base constructor when you're extending it, ie
class Derived : public|private|protected Base

A conclusion is where you got tired of thinking.
#define class struct    // All is public.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users