Click here to Skip to main content
16,007,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VC++6 InitInstance strange thing? Pin
Joan M29-Dec-06 10:56
professionalJoan M29-Dec-06 10:56 
GeneralRe: VC++6 InitInstance strange thing? Pin
Joan M30-Dec-06 2:40
professionalJoan M30-Dec-06 2:40 
GeneralRe: VC++6 InitInstance strange thing? Pin
Joan M29-Dec-06 10:15
professionalJoan M29-Dec-06 10:15 
AnswerRe: VC++6 InitInstance strange thing? [modified] Pin
Cristian Amarie29-Dec-06 22:53
Cristian Amarie29-Dec-06 22:53 
GeneralRe: VC++6 InitInstance strange thing? Pin
Joan M30-Dec-06 2:39
professionalJoan M30-Dec-06 2:39 
AnswerRe: VC++6 InitInstance strange thing? Pin
Gary R. Wheeler30-Dec-06 3:44
Gary R. Wheeler30-Dec-06 3:44 
GeneralRe: VC++6 InitInstance strange thing? Pin
Joan M30-Dec-06 3:49
professionalJoan M30-Dec-06 3:49 
GeneralRe: VC++6 InitInstance strange thing? Pin
Gary R. Wheeler30-Dec-06 8:23
Gary R. Wheeler30-Dec-06 8:23 
Joan Murt wrote:
I could delete something that could be deleted before without any problem


That's not quite the case. You can delete a pointer that's set to NULL safely. I was just pointing out (pardon the pun) that the "if (pointer) delete pointer;" logic you had before could simply be expressed as "delete pointer;".

My typical practice is to do this kind of thing:
Thing *pointer = new Thing;
// use pointer
// ...
// conditionally destroy it
if (SomethingHappens()) {
  delete pointer;
  pointer = NULL;
}
// do more stuff
// ...
// final, unconditional cleanup
delete pointer;
pointer = NULL;



Software Zen: delete this;

GeneralRe: VC++6 InitInstance strange thing? Pin
Joan M30-Dec-06 8:33
professionalJoan M30-Dec-06 8:33 
QuestionImage compression? Pin
Dave Calkins29-Dec-06 9:27
Dave Calkins29-Dec-06 9:27 
AnswerRe: Image compression? Pin
Dave Calkins29-Dec-06 9:30
Dave Calkins29-Dec-06 9:30 
GeneralRe: Image compression? (not a real answer) Pin
Joan M29-Dec-06 10:02
professionalJoan M29-Dec-06 10:02 
AnswerRe: Image compression? Pin
Michael Dunn29-Dec-06 9:52
sitebuilderMichael Dunn29-Dec-06 9:52 
GeneralRe: Image compression? Pin
Dave Calkins29-Dec-06 10:29
Dave Calkins29-Dec-06 10:29 
AnswerRe: Image compression? Pin
Mark Salsbery30-Dec-06 8:11
Mark Salsbery30-Dec-06 8:11 
QuestionObscure Serial Port question Pin
Joe Woodbury29-Dec-06 8:24
professionalJoe Woodbury29-Dec-06 8:24 
QuestionHow to detect double-click on desktop window? Pin
PatrykDabrowski29-Dec-06 8:08
PatrykDabrowski29-Dec-06 8:08 
QuestionRe: How to detect double-click on desktop window? Pin
David Crow29-Dec-06 8:34
David Crow29-Dec-06 8:34 
QuestionRe: How to detect double-click on desktop window? Pin
PatrykDabrowski29-Dec-06 9:27
PatrykDabrowski29-Dec-06 9:27 
AnswerRe: How to detect double-click on desktop window? Pin
Cristian Amarie29-Dec-06 23:06
Cristian Amarie29-Dec-06 23:06 
QuestionMessage Removed Pin
29-Dec-06 7:59
Armond Sarkisian29-Dec-06 7:59 
AnswerRe: Beginner Question -- Please help Pin
David Crow29-Dec-06 8:04
David Crow29-Dec-06 8:04 
GeneralMessage Removed Pin
29-Dec-06 8:51
Armond Sarkisian29-Dec-06 8:51 
GeneralRe: Beginner Question -- Please help Pin
David Crow29-Dec-06 8:57
David Crow29-Dec-06 8:57 
AnswerRe: Beginner Question -- Please help Pin
Hamid_RT29-Dec-06 17:14
Hamid_RT29-Dec-06 17:14 

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.