Click here to Skip to main content
16,005,141 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: delete or delete [ ]?? Pin
sunit515-Nov-05 2:01
sunit515-Nov-05 2:01 
AnswerRe: delete or delete [ ]?? Pin
toxcct15-Nov-05 2:21
toxcct15-Nov-05 2:21 
QuestionHow can I copy a opened or shared file (like NTUSER.DAT) Pin
Karl Haupt15-Nov-05 1:07
Karl Haupt15-Nov-05 1:07 
Questionstartup application on pocketpc Pin
sudabeh15-Nov-05 0:33
sudabeh15-Nov-05 0:33 
AnswerRe: startup application on pocketpc Pin
toxcct15-Nov-05 1:10
toxcct15-Nov-05 1:10 
GeneralRe: startup application on pocketpc Pin
sudabeh15-Nov-05 18:09
sudabeh15-Nov-05 18:09 
QuestionVirtual constructors... Pin
funwithdolphin15-Nov-05 0:07
funwithdolphin15-Nov-05 0:07 
AnswerRe: Virtual constructors... Pin
Cedric Moonen15-Nov-05 0:45
Cedric Moonen15-Nov-05 0:45 
Because virtual constructor are simply useless ! When constructing an object, the compiler knows exactly which object it needs to create (as opposed to the destructors). Take the following example (CChild1 and CChild2 both derive from CBase):

CBase* pData = new CChild1;<br />
CBase* pData2 = new CChild2;<br />
//<br />
// ..... Code<br />
//<br />
delete pData;<br />
delete pData2;


If you look at the above example, when creating pData and pData2, the compiler knows explicitly the type of the object being created (new CChild1 or new CChild2). But when you delete the object, the compiler doesn't know it explicitly, thus requiring a virtual destructor.
AnswerRe: Virtual constructors... Pin
Bob Stanneveld15-Nov-05 6:01
Bob Stanneveld15-Nov-05 6:01 
GeneralRe: Virtual constructors... Pin
toxcct15-Nov-05 6:24
toxcct15-Nov-05 6:24 
GeneralRe: Virtual constructors... Pin
Bob Stanneveld15-Nov-05 22:57
Bob Stanneveld15-Nov-05 22:57 
AnswerRe: Virtual constructors... Pin
cmk15-Nov-05 12:23
cmk15-Nov-05 12:23 
QuestionAbstract Base classes vs Interfaces Pin
funwithdolphin15-Nov-05 0:01
funwithdolphin15-Nov-05 0:01 
AnswerRe: Abstract Base classes vs Interfaces Pin
Cedric Moonen15-Nov-05 0:52
Cedric Moonen15-Nov-05 0:52 
AnswerRe: Abstract Base classes vs Interfaces Pin
deardear15-Nov-05 1:00
deardear15-Nov-05 1:00 
AnswerRe: Abstract Base classes vs Interfaces Pin
toxcct15-Nov-05 1:02
toxcct15-Nov-05 1:02 
AnswerRe: Abstract Base classes vs Interfaces Pin
LogiPro10125-Jan-09 11:32
LogiPro10125-Jan-09 11:32 
QuestionBuiding dll with Visual Studio 2003 Pin
Emb_Emb14-Nov-05 23:42
Emb_Emb14-Nov-05 23:42 
QuestionEasy installation of printer drivers Pin
Palani Surendrnath14-Nov-05 23:40
Palani Surendrnath14-Nov-05 23:40 
AnswerRe: Easy installation of printer drivers Pin
toxcct15-Nov-05 0:13
toxcct15-Nov-05 0:13 
QuestionActiveX control without parent container Pin
Ahsan Askare14-Nov-05 23:35
Ahsan Askare14-Nov-05 23:35 
QuestionEasy installation of printer drivers Pin
Palani Surendrnath14-Nov-05 23:23
Palani Surendrnath14-Nov-05 23:23 
Questionwstring to LPCTSTR Pin
Luke Murray14-Nov-05 22:54
Luke Murray14-Nov-05 22:54 
AnswerRe: wstring to LPCTSTR Pin
kakan15-Nov-05 0:07
professionalkakan15-Nov-05 0:07 
GeneralRe: wstring to LPCTSTR Pin
Luke Murray15-Nov-05 12:44
Luke Murray15-Nov-05 12:44 

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.