Click here to Skip to main content
15,877,637 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGlobal Variables in SDI Pin
hellogany18-Apr-10 22:33
hellogany18-Apr-10 22:33 
AnswerRe: Global Variables in SDI Pin
LittleYellowBird18-Apr-10 22:55
LittleYellowBird18-Apr-10 22:55 
GeneralRe: Global Variables in SDI Pin
hellogany18-Apr-10 22:57
hellogany18-Apr-10 22:57 
GeneralRe: Global Variables in SDI Pin
KarstenK18-Apr-10 23:32
mveKarstenK18-Apr-10 23:32 
GeneralRe: Global Variables in SDI Pin
hellogany18-Apr-10 23:39
hellogany18-Apr-10 23:39 
GeneralRe: Global Variables in SDI Pin
KarstenK18-Apr-10 23:45
mveKarstenK18-Apr-10 23:45 
QuestionRe: Global Variables in SDI Pin
David Crow19-Apr-10 3:19
David Crow19-Apr-10 3:19 
GeneralRe: Global Variables in SDI Pin
LittleYellowBird18-Apr-10 23:50
LittleYellowBird18-Apr-10 23:50 
To access 'g_m' from another cpp file you need to declare 'g_m' as an extern in that file - see my first post. In my first post I suggested that you have dedicated files for this purpose, Globals.h and Externs.h. If you do this each time a cpp file needs to access a global you can just include the 'Externs.h' so it makes life easier. Also it anables you to quickly see all your globals at one time, you could add the extern declaration to each file that needs to access the global but as your project grows it will probably get messy very quickly. Smile | :)
Ali

GeneralRe: Global Variables in SDI Pin
hellogany19-Apr-10 0:02
hellogany19-Apr-10 0:02 
GeneralRe: Global Variables in SDI Pin
hellogany19-Apr-10 0:06
hellogany19-Apr-10 0:06 
GeneralRe: Global Variables in SDI Pin
David Crow19-Apr-10 3:22
David Crow19-Apr-10 3:22 
GeneralRe: Global Variables in SDI Pin
LittleYellowBird19-Apr-10 0:12
LittleYellowBird19-Apr-10 0:12 
GeneralRe: Global Variables in SDI Pin
CPallini19-Apr-10 0:18
mveCPallini19-Apr-10 0:18 
GeneralRe: Global Variables in SDI Pin
hellogany19-Apr-10 0:26
hellogany19-Apr-10 0:26 
GeneralRe: Global Variables in SDI Pin
Cedric Moonen19-Apr-10 0:52
Cedric Moonen19-Apr-10 0:52 
GeneralRe: Global Variables in SDI Pin
LittleYellowBird19-Apr-10 0:26
LittleYellowBird19-Apr-10 0:26 
GeneralRe: Global Variables in SDI Pin
CPallini19-Apr-10 0:37
mveCPallini19-Apr-10 0:37 
GeneralRe: Global Variables in SDI Pin
LittleYellowBird19-Apr-10 0:45
LittleYellowBird19-Apr-10 0:45 
GeneralRe: Global Variables in SDI Pin
CPallini19-Apr-10 0:50
mveCPallini19-Apr-10 0:50 
GeneralRe: Global Variables in SDI Pin
hellogany19-Apr-10 0:58
hellogany19-Apr-10 0:58 
GeneralRe: Global Variables in SDI Pin
CPallini19-Apr-10 1:20
mveCPallini19-Apr-10 1:20 
GeneralRe: Global Variables in SDI Pin
hellogany19-Apr-10 17:00
hellogany19-Apr-10 17:00 
GeneralRe: Global Variables in SDI Pin
CPallini19-Apr-10 22:02
mveCPallini19-Apr-10 22:02 
GeneralRe: Global Variables in SDI Pin
Iain Clarke, Warrior Programmer19-Apr-10 23:13
Iain Clarke, Warrior Programmer19-Apr-10 23:13 
GeneralRe: Global Variables in SDI Pin
hellogany20-Apr-10 20:22
hellogany20-Apr-10 20:22 

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.