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

C / C++ / MFC

 
GeneralRe: Setting a folder inside Browse for folder dialog. Pin
skullfire2-Nov-06 12:09
skullfire2-Nov-06 12:09 
Questiontype casting Pin
Waldermort2-Nov-06 5:27
Waldermort2-Nov-06 5:27 
QuestionRe: type casting Pin
David Crow2-Nov-06 5:35
David Crow2-Nov-06 5:35 
AnswerRe: type casting Pin
Waldermort2-Nov-06 5:41
Waldermort2-Nov-06 5:41 
GeneralRe: type casting Pin
Zac Howland2-Nov-06 5:47
Zac Howland2-Nov-06 5:47 
GeneralRe: type casting Pin
Waldermort2-Nov-06 5:54
Waldermort2-Nov-06 5:54 
GeneralRe: type casting Pin
David Crow2-Nov-06 6:00
David Crow2-Nov-06 6:00 
GeneralRe: type casting Pin
Waldermort2-Nov-06 6:10
Waldermort2-Nov-06 6:10 
The question is simple, regardless of the type of pointer, how can you test it is still pointing to a valid location and not since gone out of scope?

I am passing a pointer to a class. The class will store the pointer and later call methods from the pointer. If I pass in a pointer, then delete the memory it's pointing to, then try to call those methods, the program will crash, even though the stored pointer is holding what it thinks is a valid address. There must be a simple way to test a pointer.
GeneralRe: type casting Pin
David Crow2-Nov-06 6:16
David Crow2-Nov-06 6:16 
GeneralRe: type casting Pin
Waldermort2-Nov-06 6:24
Waldermort2-Nov-06 6:24 
QuestionRe: type casting Pin
David Crow2-Nov-06 6:29
David Crow2-Nov-06 6:29 
AnswerRe: type casting Pin
Waldermort2-Nov-06 6:51
Waldermort2-Nov-06 6:51 
GeneralRe: type casting Pin
Zac Howland2-Nov-06 10:37
Zac Howland2-Nov-06 10:37 
GeneralRe: type casting Pin
David Crow2-Nov-06 5:57
David Crow2-Nov-06 5:57 
GeneralRe: type casting Pin
Waldermort2-Nov-06 6:05
Waldermort2-Nov-06 6:05 
GeneralRe: type casting Pin
Maximilien2-Nov-06 7:18
Maximilien2-Nov-06 7:18 
GeneralRe: type casting Pin
Waldermort2-Nov-06 9:18
Waldermort2-Nov-06 9:18 
GeneralRe: type casting Pin
PJ Arends2-Nov-06 7:28
professionalPJ Arends2-Nov-06 7:28 
GeneralRe: type casting [modified] Pin
Waldermort2-Nov-06 9:21
Waldermort2-Nov-06 9:21 
GeneralRe: type casting Pin
Michael Dunn2-Nov-06 8:53
sitebuilderMichael Dunn2-Nov-06 8:53 
GeneralRe: type casting Pin
Waldermort2-Nov-06 9:38
Waldermort2-Nov-06 9:38 
GeneralRe: type casting Pin
Maximilien2-Nov-06 9:52
Maximilien2-Nov-06 9:52 
GeneralRe: type casting Pin
Waldermort2-Nov-06 17:39
Waldermort2-Nov-06 17:39 
GeneralRe: type casting Pin
Michael Dunn2-Nov-06 10:05
sitebuilderMichael Dunn2-Nov-06 10:05 
AnswerRe: type casting Pin
Nemanja Trifunovic2-Nov-06 7:23
Nemanja Trifunovic2-Nov-06 7:23 

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.