Click here to Skip to main content
16,004,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: stdin stdout Pin
toxcct11-Oct-06 6:47
toxcct11-Oct-06 6:47 
GeneralRe: stdin stdout Pin
viliam11-Oct-06 6:49
viliam11-Oct-06 6:49 
QuestionRe: stdin stdout Pin
David Crow11-Oct-06 7:11
David Crow11-Oct-06 7:11 
AnswerRe: stdin stdout Pin
viliam11-Oct-06 7:24
viliam11-Oct-06 7:24 
Questionuml for n-queens problem Pin
pimpernel11-Oct-06 6:31
pimpernel11-Oct-06 6:31 
AnswerRe: uml for n-queens problem Pin
Galatei12-Oct-06 0:26
Galatei12-Oct-06 0:26 
QuestionHow does code find correct VTBL? Pin
sawerr11-Oct-06 6:25
sawerr11-Oct-06 6:25 
AnswerRe: How does code find correct VTBL? Pin
prasad_som12-Oct-06 20:56
prasad_som12-Oct-06 20:56 
sawerr wrote:
How many are vtables created?


one vtbale for each class having virtual function.
sawerr wrote:
But all of them has one VPTR.IS this right?


yes, but if derived class class is having virtual function, it uses vptr declared in base class, only thing its initialized to dervied class vtable.


sawerr wrote:
So if there is a VTABLE for each class but one VPTR; How can code find the correct function?
I know calling virtual func. means calling an offset.But this offset is in the class's VTABLE.But first it must find one more offset that indicate correct class?
Am i wrong?


vptr discussed above is initialized with each class's vtable in constructor of each class. So, lets say you are creating object of dervied class, then base class's constructor will call first, initializing vptr to base class's vtable. But then derived class's constructor class will be called, reinitializing it to derived class's vtable. And function would be found by indexing. because, that function will have addresses of that class's functions.


sawerr wrote:
For example i have one base class and one virtual funct. and three derived class in a dll.Here when i call to 3. derived class virtual function from base class pointer from my exe.Here first it must find 3. VTABLE and and first offset.Right?
But here we have only one VPTR so haw can it find 3. VTABLE and then offset of the function?


Not clear about question . Confused | :confused:


QuestionPropertySheet as the main application window? Pin
petrkar11-Oct-06 5:54
petrkar11-Oct-06 5:54 
AnswerRe: PropertySheet as the main application window? Pin
Mark Salsbery11-Oct-06 6:37
Mark Salsbery11-Oct-06 6:37 
AnswerRe: PropertySheet as the main application window? Pin
David Crow11-Oct-06 7:13
David Crow11-Oct-06 7:13 
QuestionProblem with modeless dialog - PLEASE HELP! Pin
arrayjet_c++11-Oct-06 5:03
arrayjet_c++11-Oct-06 5:03 
AnswerRe: Problem with modeless dialog - PLEASE HELP! Pin
led mike11-Oct-06 6:01
led mike11-Oct-06 6:01 
AnswerRe: Problem with modeless dialog - PLEASE HELP! Pin
Galatei12-Oct-06 0:03
Galatei12-Oct-06 0:03 
GeneralRe: Problem with modeless dialog - PLEASE HELP! Pin
arrayjet_c++12-Oct-06 5:48
arrayjet_c++12-Oct-06 5:48 
AnswerRe: Problem with modeless dialog - PLEASE HELP! Pin
Galatei12-Oct-06 6:58
Galatei12-Oct-06 6:58 
GeneralRe: Problem with modeless dialog - PLEASE HELP! Pin
arrayjet_c++12-Oct-06 22:57
arrayjet_c++12-Oct-06 22:57 
GeneralRe: Problem with modeless dialog - PLEASE HELP! Pin
Galatei12-Oct-06 23:00
Galatei12-Oct-06 23:00 
QuestionHow to change the tooltip text on the statusbar when mouse move over diffrent tool buttons in the toolbar? Pin
zhonglin.liang11-Oct-06 3:54
zhonglin.liang11-Oct-06 3:54 
AnswerRe: How to change the tooltip text on the statusbar when mouse move over diffrent tool buttons in the toolbar? Pin
Mark Salsbery11-Oct-06 6:46
Mark Salsbery11-Oct-06 6:46 
QuestionHow to uninstall a service when it is stopped? Pin
sharkmouse11-Oct-06 2:44
sharkmouse11-Oct-06 2:44 
AnswerRe: How to uninstall a service when it is stopped? Pin
sharkmouse11-Oct-06 18:54
sharkmouse11-Oct-06 18:54 
AnswerRe: How to uninstall a service when it is stopped? Pin
Galatei11-Oct-06 23:47
Galatei11-Oct-06 23:47 
GeneralRe: How to uninstall a service when it is stopped? Pin
sharkmouse12-Oct-06 19:28
sharkmouse12-Oct-06 19:28 
GeneralRe: How to uninstall a service when it is stopped? Pin
Galatei12-Oct-06 23:09
Galatei12-Oct-06 23:09 

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.