Need some kind of example
I have a program I'm making with MFC and I need to figure out how to do something. Not using global variables or anything, but I have....
--One main window, which has options to open up two other dialog boxes
--One of the dialog boxes is a check box
--The other is just enter one line of text then hit 'ok'
For the check box, I have to save the values of the boxes (true or false, of course) in the main window, so it can remember it as to where when I open the dialog box again, it remembers the options chosen last (and has those boxes already checked).
I was told to create a class like getValue() inside both dialog box classes, which would allow the main window class to access that variable and save it to local variables created in the main window class for future reference, or for the main window to use it in its own methods.
I'm just not sure how to:
--Organize things as to how to do something like that
--Would I just call the method right after DoModal, or in my "OnOk" method which confirms the choices?
--Do I just create variables in all three classes (main window, two dialog), make a method that the main window variables are equal to the dialog box variables I need, then work from there?
I'm sorry if this is hard to understand, a little out of it. But I'll provide further explanation if necessary.
Thanks.
I just need to know how to get variables from one class to another since I forgot :(
--One main window, which has options to open up two other dialog boxes
--One of the dialog boxes is a check box
--The other is just enter one line of text then hit 'ok'
For the check box, I have to save the values of the boxes (true or false, of course) in the main window, so it can remember it as to where when I open the dialog box again, it remembers the options chosen last (and has those boxes already checked).
I was told to create a class like getValue() inside both dialog box classes, which would allow the main window class to access that variable and save it to local variables created in the main window class for future reference, or for the main window to use it in its own methods.
I'm just not sure how to:
--Organize things as to how to do something like that
--Would I just call the method right after DoModal, or in my "OnOk" method which confirms the choices?
--Do I just create variables in all three classes (main window, two dialog), make a method that the main window variables are equal to the dialog box variables I need, then work from there?
I'm sorry if this is hard to understand, a little out of it. But I'll provide further explanation if necessary.
Thanks.
I just need to know how to get variables from one class to another since I forgot :(
