Click here to Skip to main content
15,921,295 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Troubling creating object Pin
Maximilien22-Oct-04 9:51
Maximilien22-Oct-04 9:51 
GeneralRe: Troubling creating object Pin
AmorphousP22-Oct-04 10:34
AmorphousP22-Oct-04 10:34 
GeneralRe: Troubling creating object Pin
David Crow22-Oct-04 9:53
David Crow22-Oct-04 9:53 
GeneralRe: Troubling creating object Pin
AmorphousP22-Oct-04 10:29
AmorphousP22-Oct-04 10:29 
GeneralRe: Troubling creating object Pin
dharani26-Oct-04 22:44
dharani26-Oct-04 22:44 
GeneralRe: Troubling creating object Pin
AmorphousP27-Oct-04 9:51
AmorphousP27-Oct-04 9:51 
GeneralAbstract member functions - strange phenomenon open to discussion: Pin
Nick Nougat22-Oct-04 6:54
Nick Nougat22-Oct-04 6:54 
GeneralRe: Abstract member functions - strange phenomenon open to discussion: Pin
Roger Allen22-Oct-04 7:13
Roger Allen22-Oct-04 7:13 
You cannot call a virtual function of a derived class from a base class constructor. This is due to the order of construction. Base classes are built first so there is no vtable pointer available to call the correct function in the derived class, which is yet to be constructed.

You need the function body as the virtual call compiles to the base class member function not the derived class one.

You need a two stage construction method to handle what you need to do.

x = new drieved;
x.Initialise();


Where the initialise function calls the correct virtual functions once the object is fully constructed.

If you vote me down, my score will only get lower
GeneralRe: Abstract member functions - strange phenomenon open to discussion: Pin
Nick Nougat22-Oct-04 7:58
Nick Nougat22-Oct-04 7:58 
QuestionHow can I programmatically install a visual C++ add-in for visual C++? Pin
Behzad Ebrahimi22-Oct-04 5:56
Behzad Ebrahimi22-Oct-04 5:56 
GeneralPeek stdin Pin
peterchen22-Oct-04 5:50
peterchen22-Oct-04 5:50 
GeneralRe: Peek stdin Pin
David Crow22-Oct-04 6:04
David Crow22-Oct-04 6:04 
GeneralPlease help me with MFC Dialogs Pin
Member 214873122-Oct-04 5:22
Member 214873122-Oct-04 5:22 
GeneralRe: Please help me with MFC Dialogs Pin
David Crow22-Oct-04 5:33
David Crow22-Oct-04 5:33 
GeneralRe: Please help me with MFC Dialogs Pin
Member 214873122-Oct-04 5:34
Member 214873122-Oct-04 5:34 
GeneralRe: Please help me with MFC Dialogs Pin
David Crow22-Oct-04 5:37
David Crow22-Oct-04 5:37 
GeneralRe: Please help me with MFC Dialogs Pin
Buyer122-Oct-04 5:42
sussBuyer122-Oct-04 5:42 
GeneralRe: Please help me with MFC Dialogs Pin
David Crow22-Oct-04 5:46
David Crow22-Oct-04 5:46 
GeneralRe: Please help me with MFC Dialogs Pin
Buyer122-Oct-04 5:53
sussBuyer122-Oct-04 5:53 
GeneralRe: Please help me with MFC Dialogs Pin
David Crow22-Oct-04 5:57
David Crow22-Oct-04 5:57 
GeneralRe: Please help me with MFC Dialogs Pin
Buyer122-Oct-04 6:10
sussBuyer122-Oct-04 6:10 
GeneralRe: Please help me with MFC Dialogs Pin
David Crow22-Oct-04 6:14
David Crow22-Oct-04 6:14 
GeneralRe: Please help me with MFC Dialogs Pin
Buyer122-Oct-04 6:15
sussBuyer122-Oct-04 6:15 
Generalmetadata shell extension handler Pin
elda0122-Oct-04 5:06
elda0122-Oct-04 5:06 
Generalpreprocessor defines Pin
Brian van der Beek22-Oct-04 4:03
Brian van der Beek22-Oct-04 4:03 

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.