Click here to Skip to main content
15,915,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: detect invalid reference Pin
toxcct14-Feb-07 5:24
toxcct14-Feb-07 5:24 
GeneralRe: detect invalid reference Pin
Mr.Brainley14-Feb-07 5:35
Mr.Brainley14-Feb-07 5:35 
GeneralRe: detect invalid reference [modified] Pin
toxcct14-Feb-07 5:37
toxcct14-Feb-07 5:37 
GeneralRe: detect invalid reference Pin
Mr.Brainley14-Feb-07 5:54
Mr.Brainley14-Feb-07 5:54 
GeneralRe: detect invalid reference Pin
toxcct14-Feb-07 5:58
toxcct14-Feb-07 5:58 
GeneralRe: detect invalid reference Pin
David Crow14-Feb-07 5:43
David Crow14-Feb-07 5:43 
AnswerRe: detect invalid reference Pin
Michael Dunn14-Feb-07 8:57
sitebuilderMichael Dunn14-Feb-07 8:57 
GeneralRe: detect invalid reference Pin
Stephen Hewitt14-Feb-07 11:50
Stephen Hewitt14-Feb-07 11:50 
Michael Dunn wrote:
A try/catch around the dereference would do it, but it's cumbersome to have many of those throughout the app. In C++, it's your responsibility to not do that in the first place.

 
I don't think it would (do it). This approach is dangerous. The memory manager could have reused the address that used to contain the vector's contents after the vector has been destroyed. This technique can not be relied upon.


Steve

AnswerRe: detect invalid reference Pin
John R. Shaw14-Feb-07 11:08
John R. Shaw14-Feb-07 11:08 
AnswerRe: detect invalid reference Pin
Stephen Hewitt14-Feb-07 11:46
Stephen Hewitt14-Feb-07 11:46 
AnswerRe: detect invalid reference Pin
Nemanja Trifunovic14-Feb-07 14:34
Nemanja Trifunovic14-Feb-07 14:34 
QuestionC->C++ ported app - unresolved externals Pin
nadiric14-Feb-07 5:04
nadiric14-Feb-07 5:04 
AnswerRe: C->C++ ported app - unresolved externals Pin
nadiric14-Feb-07 5:17
nadiric14-Feb-07 5:17 
GeneralRe: C->C++ ported app - unresolved externals Pin
John R. Shaw14-Feb-07 8:39
John R. Shaw14-Feb-07 8:39 
QuestionRegistering ActiveX ctrls on PC & Embedded platforms Pin
Like2Byte14-Feb-07 3:34
Like2Byte14-Feb-07 3:34 
AnswerRe: Registering ActiveX ctrls on PC & Embedded platforms Pin
Like2Byte14-Feb-07 5:37
Like2Byte14-Feb-07 5:37 
QuestionArray pointer lost Pin
Renato Carvalho14-Feb-07 2:59
Renato Carvalho14-Feb-07 2:59 
AnswerRe: Array pointer lost [modified] Pin
prasad_som14-Feb-07 3:13
prasad_som14-Feb-07 3:13 
GeneralRe: Array pointer lost Pin
David Crow14-Feb-07 3:24
David Crow14-Feb-07 3:24 
GeneralRe: Array pointer lost Pin
prasad_som14-Feb-07 4:30
prasad_som14-Feb-07 4:30 
GeneralRe: Array pointer lost Pin
David Crow14-Feb-07 4:40
David Crow14-Feb-07 4:40 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 4:49
Renato Carvalho14-Feb-07 4:49 
GeneralRe: Array pointer lost Pin
David Crow14-Feb-07 4:55
David Crow14-Feb-07 4:55 
GeneralRe: Array pointer lost Pin
prasad_som14-Feb-07 17:26
prasad_som14-Feb-07 17:26 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 4:31
Renato Carvalho14-Feb-07 4:31 

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.