Click here to Skip to main content
16,012,107 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Cpu usage? Pin
David Crow12-Jan-05 5:43
David Crow12-Jan-05 5:43 
GeneralListBox problem Pin
Ivan Cachicatari11-Jan-05 18:54
Ivan Cachicatari11-Jan-05 18:54 
GeneralRe: ListBox problem Pin
basementman12-Jan-05 4:01
basementman12-Jan-05 4:01 
GeneralRe: ListBox problem Pin
Ivan Cachicatari12-Jan-05 7:27
Ivan Cachicatari12-Jan-05 7:27 
Generalprocess ID to process name Pin
2000ram11-Jan-05 18:22
2000ram11-Jan-05 18:22 
GeneralRe: process ID to process name Pin
Aamir Butt11-Jan-05 19:33
Aamir Butt11-Jan-05 19:33 
GeneralVirtual Destructors Pin
Neelesh K J Jain11-Jan-05 18:07
Neelesh K J Jain11-Jan-05 18:07 
GeneralRe: Virtual Destructors Pin
Cedric Moonen11-Jan-05 19:58
Cedric Moonen11-Jan-05 19:58 
That's a good question Smile | :) .

In fact if we don't need virtual constructor, it's because when you instanciate your pointer, you ALWAYS know what class you instanciate. So take the example of one base class (CBase) and one child class (CChild). If you have an uninstancied pointer to the base class:

CBase* pPointer;

If you instanciate it into a child class:

pPointer = new CChild;

the compiler knows exactly that you want to create a child class (first the compiler creates a child class and then it stores the pointer into the uninstancied pointer).

So know you've done a lot of things with this pointer and you want to destroy it:

delete pPointer;

The compiler just knows that the pointer is from type CBase (that's how it has been declared) without knowing that it has been instancied as a child class. So, in this case your destructor must be virtual so that the compiler will call the destructor of your child class and not from the base class.

Hope this helps
GeneralRe: Virtual Destructors Pin
digwizfox13-Jan-05 7:16
digwizfox13-Jan-05 7:16 
GeneralGDI Edit Questions, Please Help Pin
c++code10111-Jan-05 17:50
c++code10111-Jan-05 17:50 
GeneralCProgressCtrl problem in Status bar Pin
Neelesh K J Jain11-Jan-05 16:44
Neelesh K J Jain11-Jan-05 16:44 
GeneralNot a problem... Pin
Kochise11-Jan-05 21:51
Kochise11-Jan-05 21:51 
Generalgethostbyname C2143 Pin
Vadim Tabakman11-Jan-05 14:57
Vadim Tabakman11-Jan-05 14:57 
GeneralRe: gethostbyname C2143 Pin
Antony M Kancidrowski12-Jan-05 2:28
Antony M Kancidrowski12-Jan-05 2:28 
GeneralRe: gethostbyname C2143 Pin
Vadim Tabakman12-Jan-05 10:00
Vadim Tabakman12-Jan-05 10:00 
GeneralCRichEditView - Dragging file into Pin
Ed K11-Jan-05 14:41
Ed K11-Jan-05 14:41 
GeneralRe: CRichEditView - Dragging file into : ON_WM_DROPFILES() Pin
Ed K12-Jan-05 6:42
Ed K12-Jan-05 6:42 
Generalrecommend gui library Pin
Anonymous11-Jan-05 14:38
Anonymous11-Jan-05 14:38 
GeneralRe: recommend gui library Pin
Ed K11-Jan-05 14:45
Ed K11-Jan-05 14:45 
GeneralRetrieve FDT(File Directory Table) for specific folders!! !! Pin
LiYS11-Jan-05 13:41
LiYS11-Jan-05 13:41 
GeneralRe: Retrieve FDT(File Directory Table) for specific folders!! !! Pin
Maximilien11-Jan-05 14:03
Maximilien11-Jan-05 14:03 
GeneralRe: Retrieve FDT(File Directory Table) for specific folders!! !! Pin
LiYS11-Jan-05 14:21
LiYS11-Jan-05 14:21 
GeneralRe: Retrieve FDT(File Directory Table) for specific folders!! !! Pin
Maximilien11-Jan-05 16:05
Maximilien11-Jan-05 16:05 
GeneralRe: Retrieve FDT(File Directory Table) for specific folders!! !! Pin
LiYS11-Jan-05 16:18
LiYS11-Jan-05 16:18 
GeneralRe: Retrieve FDT(File Directory Table) for specific folders!! !! Pin
Maximilien12-Jan-05 0:41
Maximilien12-Jan-05 0:41 

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.