Archived

This topic is now archived and is closed to further replies.

sending data between dialog classes

This topic is 5175 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites