There are no best methods for all cases.
You can use Windows message, a variables of dialogs, static/global variable, Registry, File, Atom Table, Database etc...
If You say, what do You wish to do, I (may be) can say, what is the best solution.
Imagine you have two dialog classes, and want to pass some variables to the one dialog, when you close the other one.
Do I have to declare global variables or is there a better way?
If the destination Dialog exists before source Dialog was closed, You can do it directly:
1. Make destination dialog class known for source dialog (#include "source_dlg.h" in File destination_dlg.c).
2. Make destination dialog pointer known for source dlg (for example, make global variable of typ pointer
and init it in constructor of destination dialog throw 'this').
3. Make in OnOK() - Funktion of source Dialog all You wish with destination dialog (I suppose, You wish to save parameters by OK only).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.