Click to See Complete Forum and Search --> : Passing between classes


jmgreene
July 14th, 1999, 10:01 AM
I have a dialog based application (..MainDialog). I have two other classes that handle modeless
modeless dialogs (..Dialog1, Dialog2). Well I have Dialog1* dlg1 & Dialog2* dlg2 declared in
MainDialog.h. I then call dlg1->Create() and so on to create the dialogs and so on. Well I want
to do the reverse as well. I want to make it so that when I click a button on one of the modeless
dialogs, it will change the selection on a list box on the MainDialog. I tried to create
MainDialog* dlg and then use it (dlg->...), but when I declare dlg I get errors saying that
MainDialog is not a class or namespace and then it doesn't recognize dlg1 & dlg2. Does anyone
have any idea what is wrong or how I can call functions from the two modeless dialogs.

July 14th, 1999, 11:32 AM
what i think you should do is add some function in your MainDialog (something like OnClick, OnOK, OnCancel or any event you want like window change or something like that )and in this function that you override you can do something like:

selection_of_the_list_box_of_MainDialog = dlg1->GetValueOfTheButtonPressed()

hope it helps