-
October 19th, 2009, 06:08 AM
#1
help with global variables in MFC dialog Application
Dear all,
I am using MFC dialog application to get an text input from the user and make processing on it and then reply with response but I need to declare some variables to be working throughout the whole system cycle(I think its called global variables) to be accessible whereever from my system coding files. Because I need to deal with the variable changes during the system cycle.
I tired many things Like: static ,extern. But till now I'm beginner in this language so I didn't know how to deal with them in .cpp files.
Please any help will be appreciated.
Best regards.
-
October 19th, 2009, 08:45 AM
#2
Re: help with global variables in MFC dialog Application
In your main application's .cpp file, you can declare your global variable at the top of the file
Then in each other .cpp file you need access to it, at the top of the file
Code:
extern int g_nValue;
By the way, this belongs in the Visual C++ forum
-
October 19th, 2009, 10:32 AM
#3
Re: help with global variables in MFC dialog Application
Thank you for your help. its work fine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|