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

C / C++ / MFC

 
Generalglobal variables Pin
dolph_loe22-Jun-04 5:20
dolph_loe22-Jun-04 5:20 
GeneralRe: global variables Pin
Johan Rosengren22-Jun-04 5:28
Johan Rosengren22-Jun-04 5:28 
GeneralRe: global variables Pin
dolph_loe22-Jun-04 6:42
dolph_loe22-Jun-04 6:42 
GeneralRe: global variables Pin
Johan Rosengren22-Jun-04 8:29
Johan Rosengren22-Jun-04 8:29 
GeneralRe: global variables Pin
jmkhael22-Jun-04 5:29
jmkhael22-Jun-04 5:29 
GeneralRe: global variables Pin
David Crow22-Jun-04 5:53
David Crow22-Jun-04 5:53 
GeneralRe: global variables Pin
dolph_loe22-Jun-04 6:59
dolph_loe22-Jun-04 6:59 
GeneralRe: global variables Pin
Henry miller22-Jun-04 8:15
Henry miller22-Jun-04 8:15 
Either you are doing it but just don't know your code well enough to to recall where. (This happens more often than you would think), or you are overwriting it thourgh some memory that isn't as big as you think it is. Look for a global array near that point that is one member too small or some such.

You might be able to get a clue by seeing what it was changed to. Pull up your debugger after this happens, and look in memory to see if there is something supicious, not just with the variable overwritten, but also others near that location. If it is a string you have a good clue.

Your confusion on how to find these is one of the lesser reasons to consider global variables evil. (There is sometimes no way to get around them, but the less you have the better, and any you can get rid of is generally good practice)

Good luck.
GeneralModeless Dialogs & Z order Pin
Mark Kinsley22-Jun-04 4:47
Mark Kinsley22-Jun-04 4:47 
GeneralRe: Modeless Dialogs & Z order Pin
V.22-Jun-04 4:57
professionalV.22-Jun-04 4:57 
GeneralRe: Modeless Dialogs & Z order Pin
PJ Arends22-Jun-04 5:26
professionalPJ Arends22-Jun-04 5:26 
GeneralRe: Modeless Dialogs & Z order Pin
Mark Kinsley22-Jun-04 5:49
Mark Kinsley22-Jun-04 5:49 
GeneralRe: Modeless Dialogs & Z order Pin
PJ Arends22-Jun-04 10:12
professionalPJ Arends22-Jun-04 10:12 
GeneralRe: Modeless Dialogs & Z order Pin
Mark Kinsley22-Jun-04 21:36
Mark Kinsley22-Jun-04 21:36 
GeneralModeless Dialogs Pin
si_6922-Jun-04 4:10
si_6922-Jun-04 4:10 
GeneralRe: Modeless Dialogs Pin
Johan Rosengren22-Jun-04 5:21
Johan Rosengren22-Jun-04 5:21 
GeneralRe: Modeless Dialogs Pin
David Crow22-Jun-04 5:59
David Crow22-Jun-04 5:59 
GeneralRe: Modeless Dialogs Pin
si_6923-Jun-04 1:17
si_6923-Jun-04 1:17 
GeneralRe: Modeless Dialogs Pin
David Crow23-Jun-04 2:04
David Crow23-Jun-04 2:04 
GeneralRe: Modeless Dialogs Pin
si_6923-Jun-04 2:28
si_6923-Jun-04 2:28 
GeneralRe: Modeless Dialogs Pin
David Crow23-Jun-04 2:40
David Crow23-Jun-04 2:40 
Generaldouble and float problem Pin
NMiceli22-Jun-04 3:50
NMiceli22-Jun-04 3:50 
GeneralRe: double and float problem Pin
Tim Smith22-Jun-04 4:01
Tim Smith22-Jun-04 4:01 
GeneralRe: double and float problem Pin
Antony M Kancidrowski22-Jun-04 4:20
Antony M Kancidrowski22-Jun-04 4:20 
GeneralRe: double and float problem Pin
David Crow22-Jun-04 6:09
David Crow22-Jun-04 6:09 

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.