Click here to Skip to main content
15,925,081 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get the application's full path and file name at run time? Pin
James R. Twine23-Feb-05 2:38
James R. Twine23-Feb-05 2:38 
GeneralProblem with CGridCtrl with combo box Pin
Bob Stanneveld23-Feb-05 1:55
Bob Stanneveld23-Feb-05 1:55 
GeneralHelp needed! Pin
Member 25547123-Feb-05 1:44
Member 25547123-Feb-05 1:44 
GeneralRe: Help needed! Pin
David Crow23-Feb-05 2:31
David Crow23-Feb-05 2:31 
GeneralRe: Help needed! Pin
Steen Krogsgaard23-Feb-05 2:42
Steen Krogsgaard23-Feb-05 2:42 
GeneralRe: Help needed! Pin
Steen Krogsgaard23-Feb-05 2:32
Steen Krogsgaard23-Feb-05 2:32 
GeneralRe: Help needed! Pin
Ryan Binns23-Feb-05 17:11
Ryan Binns23-Feb-05 17:11 
GeneralRe: Help needed! Pin
Steen Krogsgaard23-Feb-05 21:46
Steen Krogsgaard23-Feb-05 21:46 
Ryan Binns wrote:
Don't take it personally, but that's not quite right

Unfortunately I'm quite sure I'm right (although being so sure of one self always comes with the risk of making a complete fool of one self by actually being wrong Poke tongue | ;-P )

Look at MSDN, "C++: Under the Hood" by Jan Gray (it's from 1994 and in my October 2001 version of MSDN, but I believe it's still holds true). Each object contains a pointer to the vtable, but not the vtable itself. This pointer is used at runtime to look up the adress of the virtual function.

It wouldn't make much sense to have a per-instantiation vtable. Two objects of the same type will per definition have the same vtable (otherwise they would not be of the same type). What polymorphism does is to allow you to delay the linking so that you don't have to know the exact type of the object in order to call functions on it. However, the compiler will have to know what index in the vtable to use at compile time, that's why the base class vtable entries preceeds the derived class vtable entries. And that's why multiple inheritance is such a mess!

This is of course compiler-implementation dependent, but I'm pretty sure that the above holds true for VC++.

Cheers
Steen.

"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
GeneralRe: Help needed! Pin
Ryan Binns24-Feb-05 12:38
Ryan Binns24-Feb-05 12:38 
GeneralRe: Help needed! Pin
Steen Krogsgaard24-Feb-05 22:18
Steen Krogsgaard24-Feb-05 22:18 
GeneralRe: Help needed! Pin
Ryan Binns25-Feb-05 1:06
Ryan Binns25-Feb-05 1:06 
GeneralHandling messages in another class Pin
tttyip23-Feb-05 0:25
tttyip23-Feb-05 0:25 
GeneralRe: Handling messages in another class Pin
RChin23-Feb-05 0:51
RChin23-Feb-05 0:51 
Generalmerge some cells from the same row in CListCtrl Pin
catalin buj23-Feb-05 0:14
catalin buj23-Feb-05 0:14 
GeneralRe: merge some cells from the same row in CListCtrl Pin
bitpusher23-Feb-05 9:56
bitpusher23-Feb-05 9:56 
GeneralRe: merge some cells from the same row in CListCtrl Pin
catalin buj23-Feb-05 22:19
catalin buj23-Feb-05 22:19 
GeneralProblem with metafile-playback in print preview Pin
Christian Waluga22-Feb-05 23:35
Christian Waluga22-Feb-05 23:35 
GeneralRe: Problem with metafile-playback in print preview Pin
Christian Waluga23-Feb-05 22:15
Christian Waluga23-Feb-05 22:15 
GeneralUse C++ written class in VB Pin
Logan from Singapore22-Feb-05 23:33
Logan from Singapore22-Feb-05 23:33 
GeneralRe: Use C++ written class in VB Pin
ThatsAlok22-Feb-05 23:52
ThatsAlok22-Feb-05 23:52 
Generalappend CString [] Pin
kittunair22-Feb-05 23:28
kittunair22-Feb-05 23:28 
GeneralRe: append CString [] Pin
ThatsAlok22-Feb-05 23:50
ThatsAlok22-Feb-05 23:50 
GeneralRe: append CString [] Pin
David Nash23-Feb-05 7:03
David Nash23-Feb-05 7:03 
GeneralDate Validation Pin
Renjith Ramachandran22-Feb-05 23:16
Renjith Ramachandran22-Feb-05 23:16 
GeneralRe: Date Validation Pin
David Crow23-Feb-05 2:40
David Crow23-Feb-05 2:40 

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.