ASingerMustDie
Programmer
Hi Everyone,
Thanks for all your help regarding other matters
This is almost similar to a previous question, but different enough, I feel, to warrant a seperate thread...
If one was to open a modal dialog box (Dialog2) from another dialog box (Dialog1), is it possible to reference (and assign values to) public variables of the Dialog1 class?
Dialog1.h
...
public:
int publicvar;
Dialog1.cpp
...
CDialog Dialog2;
Dialog2.DoModal();
I thought this may be possible by using the GetParent() method of Dialog2, thus:
Dialog2.cpp
...
CWnd* parentWindow = GetParent();
parentWindow.publicvar = 5;
But this is apparently not the way to go...I would appreciate any help regarding how it could be done
error C2228: left of '.publicvar' must have class/struct/union type
Thanks much,
ASMD
Thanks for all your help regarding other matters
This is almost similar to a previous question, but different enough, I feel, to warrant a seperate thread...
If one was to open a modal dialog box (Dialog2) from another dialog box (Dialog1), is it possible to reference (and assign values to) public variables of the Dialog1 class?
Dialog1.h
...
public:
int publicvar;
Dialog1.cpp
...
CDialog Dialog2;
Dialog2.DoModal();
I thought this may be possible by using the GetParent() method of Dialog2, thus:
Dialog2.cpp
...
CWnd* parentWindow = GetParent();
parentWindow.publicvar = 5;
But this is apparently not the way to go...I would appreciate any help regarding how it could be done
error C2228: left of '.publicvar' must have class/struct/union type
Thanks much,
ASMD