CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Raleigh, NC
    Posts
    47

    Passing between classes

    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.


  2. #2
    Guest

    Re: Passing between classes

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured