vc++ 6 mfc, easiest way to pass variables between dlgs?
-
i have two dlgs which i want to access the same variable, i,ve got some global variables in the "Globals" folder but i cant access them from the childdlg. i thought global was GLOBAL? how to do this easy. thx
-
i have two dlgs which i want to access the same variable, i,ve got some global variables in the "Globals" folder but i cant access them from the childdlg. i thought global was GLOBAL? how to do this easy. thx
If the variable is in the parent window which create the dialog you can use GetParent() method to get the parent window , and make sure your global variable is declared in parent header with public access.
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
-
i have two dlgs which i want to access the same variable, i,ve got some global variables in the "Globals" folder but i cant access them from the childdlg. i thought global was GLOBAL? how to do this easy. thx
rolfhorror wrote:
i,ve got some global variables in the "Global" folder
Really? I'm not the most experienced developer around but I'm pretty sure you can't put variables into folders. :rolleyes:
rolfhorror wrote:
how to do this easy.
If you don't understand that those Dialogs are Classes and/or if you don't understand how to pass/access variables between classes then my guess would be that this might be the easiest.[^]
led mike
-
rolfhorror wrote:
i,ve got some global variables in the "Global" folder
Really? I'm not the most experienced developer around but I'm pretty sure you can't put variables into folders. :rolleyes:
rolfhorror wrote:
how to do this easy.
If you don't understand that those Dialogs are Classes and/or if you don't understand how to pass/access variables between classes then my guess would be that this might be the easiest.[^]
led mike
when i say folder, i mean the "folder" at the bottom on the classtree with the name "Globals".
-
If the variable is in the parent window which create the dialog you can use GetParent() method to get the parent window , and make sure your global variable is declared in parent header with public access.
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
thanx i'll look into that
-
when i say folder, i mean the "folder" at the bottom on the classtree with the name "Globals".
-
rolfhorror wrote:
maybe you should look at that book yourself
Good one! You are well on your way to being an excellent C++ developer! Good luck.
led mike
i'm not here to flame, so no offense. it was all in good humor. :-) (by the way, i have that book)
-
i'm not here to flame, so no offense. it was all in good humor. :-) (by the way, i have that book)
rolfhorror wrote:
i'm not here to flame, so no offense. it was all in good humor.
:cool:
rolfhorror wrote:
(by the way, i have that book)
Then my comment about the dialogs being classes and that standard mechanisms for passing values or accessing values applies, should have helped yes? I mean I have not read that book but I would imagine that is covered yes?
led mike
-
rolfhorror wrote:
i'm not here to flame, so no offense. it was all in good humor.
:cool:
rolfhorror wrote:
(by the way, i have that book)
Then my comment about the dialogs being classes and that standard mechanisms for passing values or accessing values applies, should have helped yes? I mean I have not read that book but I would imagine that is covered yes?
led mike
thanx for you help :-)
-
i have two dlgs which i want to access the same variable, i,ve got some global variables in the "Globals" folder but i cant access them from the childdlg. i thought global was GLOBAL? how to do this easy. thx
just a guess, have you checked this[^] article ?
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
just a guess, have you checked this[^] article ?
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
thanx, this is what i was looking for :-)
-
i have two dlgs which i want to access the same variable, i,ve got some global variables in the "Globals" folder but i cant access them from the childdlg. i thought global was GLOBAL? how to do this easy. thx
it it is integer, than you can use PostMessage to tranfer values in active mode. since other wise just update the shared values for passive mode transfer.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/xml>