Re: Some Qs related to VTable and DialogBox!
- From: "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 Jan 2007 15:47:10 GMT
"RajanM" <Rajan.Munuswamy@xxxxxxxxx> wrote in message
news:1169562128.281283.199840@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#include<iostream>
using namespace std;
class A{
virtual void VFunc(){cout<<"VFun of Class A\n";}
};
class B:public A{ };
int main()
{
A *pa;
pa = new B ;
pa->VFunc(); //This calls Class A's VFunc
// here, Does the compiler might have created VTable for Class B or
not?
return 0;
}
Sure, of course the VTable has been created for Class B. Otherwise how
would the call pa->VFunc() correctly call A::VFunc()?
----------------
Q2: Does virtual functions have any effect wiht access specifiers?
Meaning in the above example, is it ok to put my base class virtual
function in private?
You could just try it... if you make A::VFunc() private, then you won't be
able to call it from main().
----------------------------
Q3: How to add a StatusBar containing progress bar, in a Dialog box?
Perhaps CodeProject/Codeguru has examples of this. I imagine you use
CStatusBarCtrl.
-- David (MVP)
.
- Follow-Ups:
- Re: Some Qs related to VTable and DialogBox!
- From: David Wilkinson
- Re: Some Qs related to VTable and DialogBox!
- References:
- Some Qs related to VTable and DialogBox!
- From: RajanM
- Some Qs related to VTable and DialogBox!
- Prev by Date: Re: Handling a message in a CListCtrl derived class
- Next by Date: Re: Handling a message in a CListCtrl derived class
- Previous by thread: Some Qs related to VTable and DialogBox!
- Next by thread: Re: Some Qs related to VTable and DialogBox!
- Index(es):
Relevant Pages
|