sending data between dialog classes

Started by
1 comment, last by BungoMan85 20 years, 6 months ago
i got a dialog class (mfc of course...) and when a button is pressed it creates a child dialog of another class, how can i make it so i can send data from a text input from the child window back to the parent? this->GetParent()->text="blah" for example (assuming text is a member of the parent dialog class). for some reason it dont like that. im assuming its because any dialog (one with or without the variable in question) could actualy create this dialog. im at a loss here tho, i thought about sending a message to the parent and making it so that it handles the message in the appropriet way... but i doubt thats a good idea... Bungo!
Bungo!
Advertisement
All you really need for sending messages to another dialog (window, hwnd) is the HWND handle (or the CWnd encapsulation class of MFC). Keep a handle to it when creating your dialog and you can go on sending whatever you want.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

well the GetParent() function takes care of that for me (it returns a CWnd if im not mistaken). i just figured that was kind of a sloppy method.

Bungo!
Bungo!

This topic is closed to new replies.

Advertisement