Click here to Skip to main content
15,891,248 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString reference Pin
_Flaviu17-Feb-12 19:57
_Flaviu17-Feb-12 19:57 
GeneralRe: CString reference Pin
JackDingler17-Feb-12 21:13
JackDingler17-Feb-12 21:13 
GeneralRe: CString reference Pin
Richard MacCutchan17-Feb-12 21:15
mveRichard MacCutchan17-Feb-12 21:15 
AnswerRe: CString reference Pin
bjorn_ht17-Feb-12 21:00
bjorn_ht17-Feb-12 21:00 
GeneralRe: CString reference Pin
_Flaviu19-Feb-12 9:16
_Flaviu19-Feb-12 9:16 
QuestionStatic Variable Pin
pix_programmer17-Feb-12 1:23
pix_programmer17-Feb-12 1:23 
AnswerRe: Static Variable Pin
CPallini17-Feb-12 1:48
mveCPallini17-Feb-12 1:48 
AnswerRe: Static Variable Pin
Chris Losinger17-Feb-12 1:49
professionalChris Losinger17-Feb-12 1:49 
'static', when applied to a variable definition, means you can't see the variable outside the scope of the file in which it's declared.

if you want to share a variable across CPP files, define the variable, in Menu.cpp, like this:

MenuSettings mSettings;

and then in Scroll.cpp, add the following declaration:

extern MenuSettings mSettings;

that tells the compiler to look in other files for the variable.

better yet, put extern MenuSettings mSettings; in a common header file. that way you can use the variable by simply #including the header.

also: global variables are generally not a good idea.


modified 17-Feb-12 8:35am.

QuestionVirtual Functions? Pin
msr_codeproject17-Feb-12 1:02
msr_codeproject17-Feb-12 1:02 
AnswerRe: Virtual Functions? Pin
CPallini17-Feb-12 2:15
mveCPallini17-Feb-12 2:15 
GeneralRe: Virtual Functions? Pin
msr_codeproject17-Feb-12 2:29
msr_codeproject17-Feb-12 2:29 
GeneralRe: Virtual Functions? Pin
CPallini17-Feb-12 2:42
mveCPallini17-Feb-12 2:42 
QuestionRe: Virtual Functions? Pin
David Crow17-Feb-12 2:40
David Crow17-Feb-12 2:40 
AnswerRe: Virtual Functions? PinPopular
Chuck O'Toole17-Feb-12 3:08
Chuck O'Toole17-Feb-12 3:08 
AnswerRe: Virtual Functions? Pin
jschell17-Feb-12 7:10
jschell17-Feb-12 7:10 
AnswerRe: Virtual Functions? Pin
JackDingler17-Feb-12 10:31
JackDingler17-Feb-12 10:31 
QuestionSetting Parity Bit (serial port) not working. Q for the driver guru's. Pin
Andrew Pearson16-Feb-12 14:43
Andrew Pearson16-Feb-12 14:43 
AnswerRe: Setting Parity Bit (serial port) not working. Q for the driver guru's. Pin
Peter_in_278016-Feb-12 14:52
professionalPeter_in_278016-Feb-12 14:52 
GeneralRe: Setting Parity Bit (serial port) not working. Q for the driver guru's. Pin
Andrew Pearson16-Feb-12 15:25
Andrew Pearson16-Feb-12 15:25 
GeneralRe: Setting Parity Bit (serial port) not working. Q for the driver guru's. Pin
Peter_in_278016-Feb-12 15:42
professionalPeter_in_278016-Feb-12 15:42 
GeneralRe: Setting Parity Bit (serial port) not working. Q for the driver guru's. Pin
Andrew Pearson16-Feb-12 17:57
Andrew Pearson16-Feb-12 17:57 
GeneralRe: Setting Parity Bit (serial port) not working. Q for the driver guru's. Pin
Erudite_Eric16-Feb-12 20:28
Erudite_Eric16-Feb-12 20:28 
GeneralRe: Setting Parity Bit (serial port) not working. Q for the driver guru's. Pin
Jochen Arndt16-Feb-12 23:20
professionalJochen Arndt16-Feb-12 23:20 
GeneralRe: Setting Parity Bit (serial port) not working. Q for the driver guru's. Pin
Erudite_Eric17-Feb-12 6:10
Erudite_Eric17-Feb-12 6:10 
GeneralRe: Setting Parity Bit (serial port) not working. Q for the driver guru's. Pin
Andrew Pearson17-Feb-12 21:13
Andrew Pearson17-Feb-12 21:13 

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.