Jump to content
  • Advertisement

Archived

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

BungoMan85

sending data between dialog classes

This topic is 5391 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
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.

Share this post


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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!