visual c++ - To send a custom Message from Parent Dialog Box to child Dialog Box using SendMessage() function -


there several ways use sendmessage()

  1. win32api modal

::sendmessage(h, my_msg ,0,0);

  1. mfc modal

    let's ptr having child dialog box handle can use modal

ptr->sendmessage(my_msg,0,0);

but how can child dialog box handle once clicked button in parent dialog box see this.. write code

 void ccustommessagedlg::onbnclickedopen(){          mydialog2 d2(idd_child_dialog);      d2.domodal();           } 

i need send custom message child dialog using sendmessage() api once button clicked. can please suggest solution problem

you cannot send message dialog after domodal() returns, because dialog destroyed.

in case want pass data dialog, can add member variable child dialog, say:

cstring m_strmydata; 

then use:

 mydialog2 d2(idd_child_dialog);  d2.m_strmydata = "test";  d2.domodal(); 

and access m_strmydata within child dialog.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -