Click here to Skip to main content
15,909,324 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionWhy normal virtual function required blank body in base class Pin
am 20096-Oct-10 2:22
am 20096-Oct-10 2:22 
Hi,

I have following block of code,
class Base
{
       public:
          Base()
		  { 
		     cout<<"Constructor: Base"<<endl;
		  }
          ~Base()
		  { 
			  cout<<"Destructor : Base"<<endl;
		  }
		  virtual void fun();
		   
};
class Derived: public Base
{
      
       public:
           Derived()
		   { 
			   cout<<"Constructor: Derived"<<endl;
		   }
           ~Derived()
		   { 
			   cout<<"Destructor : Derived"<<endl;
		   }
		    void fun()
		  {
		    cout<<" in der";
		  }
};
int _tmain(int argc, _TCHAR* argv[])
{
	Derived obj;
        obj.fun();
	getche();


In above code virtual fun() is showing error that it not resolved. If i add blank body then Derived class's Fun()is called. Is it necessary to have blank body for virtual function in base class and what is reason of this. OMG | :OMG:

Thanks
abm
AnswerRe: Why normal virtual function required blank body in base class Pin
Alain Rist6-Oct-10 3:13
Alain Rist6-Oct-10 3:13 
QuestionEnable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo5-Oct-10 6:58
karuuzo5-Oct-10 6:58 
AnswerRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Alain Rist5-Oct-10 21:16
Alain Rist5-Oct-10 21:16 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 1:13
karuuzo6-Oct-10 1:13 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Alain Rist6-Oct-10 2:09
Alain Rist6-Oct-10 2:09 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 3:48
karuuzo6-Oct-10 3:48 
AnswerRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Alain Rist6-Oct-10 4:19
Alain Rist6-Oct-10 4:19 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 5:14
karuuzo6-Oct-10 5:14 
AnswerRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Alain Rist6-Oct-10 5:23
Alain Rist6-Oct-10 5:23 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Richard MacCutchan6-Oct-10 4:03
mveRichard MacCutchan6-Oct-10 4:03 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 4:12
karuuzo6-Oct-10 4:12 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Richard MacCutchan6-Oct-10 5:02
mveRichard MacCutchan6-Oct-10 5:02 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 5:23
karuuzo6-Oct-10 5:23 
QuestionRegarding Tools Pin
Anil Kumar.Arvapalli3-Oct-10 21:16
Anil Kumar.Arvapalli3-Oct-10 21:16 
AnswerRe: Regarding Tools Pin
LunaticFringe4-Oct-10 12:28
LunaticFringe4-Oct-10 12:28 
AnswerRe: Regarding Tools Pin
federico.strati5-Oct-10 3:19
federico.strati5-Oct-10 3:19 
QuestionDynamic Owner-Drawn CListBox Derivative - Owner Draw Problem Pin
Kyudos3-Oct-10 13:00
Kyudos3-Oct-10 13:00 
AnswerRe: Dynamic Owner-Drawn CListBox Derivative - Owner Draw Problem Pin
Kyudos3-Oct-10 17:24
Kyudos3-Oct-10 17:24 
QuestionCustomize CMFCPropertyGrid Pin
silversamand1-Oct-10 21:37
silversamand1-Oct-10 21:37 
QuestionHow to associate CMap key value to CComboBox Pin
ptr_Electron27-Sep-10 0:49
ptr_Electron27-Sep-10 0:49 
AnswerRe: How to associate CMap key value to CComboBox [modified] Pin
Cool_Dev27-Sep-10 4:33
Cool_Dev27-Sep-10 4:33 
GeneralRe: How to associate CMap key value to CComboBox Pin
ptr_Electron27-Sep-10 18:11
ptr_Electron27-Sep-10 18:11 
GeneralRe: How to associate CMap key value to CComboBox Pin
Cool_Dev27-Sep-10 18:53
Cool_Dev27-Sep-10 18:53 
GeneralRe: How to associate CMap key value to CComboBox Pin
ptr_Electron27-Sep-10 22:14
ptr_Electron27-Sep-10 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.