For a small project, we encountered the problem of transferring data between two dialog boxes. Because we haven't used all of them for a long time, we found the solution after checking them for a long time. Here, we will summarize the content for your reference;
My requirement is to click a button in dlg1 to generate the dlg2 dialog box and use the value of the variable in dlg1 in dlg2
Solution: Execute dlg2.domodal () in the button response function; assign the value of dlg1 directly to the variable of dlg2. The reference code is as follows:
Cinfo DLG; DLG. Path = This-> path; DLG. num = This-> Number; DLG. domodal ();
Cinfo is what I call dlg2, and the Code itself is in the button response function of dlg1;
Of course, in addition to this method, I also know that global variables are defined directly in the app class, and messages are used to transmit data in various dialog boxes. However, this method is not quite useful, so some great gods know that they can communicate with each other.