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
    Posts
    11

    How exchange data among properpages

    Hello everyone:
    In my project,I met the following problem.
    I use a propersheet containing sevaral pages and I need the data exchangement among all the pages.That is to say when the data in one page has been changed,other pages which using this data must be update.
    If you like to help me solve this problem,please mail me or reply my problem.
    Thanks a lot!

    [email protected]

    andrew

  2. #2
    Join Date
    May 1999
    Posts
    42

    Re: How exchange data among properpages

    1. Assume that CMainSheet is the property sheet and CPageOne and CPageTwo are pages.
    2. In the header files for CPageOne and CPageTwo, #include CMainSheet.h, and declare this variable:

    CWnd* m_pMainSheet;

    3. Using Class Wizard, map OnSetActive for CPageOne and CPageTwo.

    4. In the OnSetActive() handlers for CPageOne and CPageTwo, add this call:

    m_pMainSheet = GetParentOwner();

    5. For any methods or data that must be visible to all pages, make them public or provide accessor methods in CMainSheet.

    6. Call the methods from CPageOne or CPageTwo using pointer notation, casting the m_pMainSheet pointer from CWnd* to CMainSheet*, like this:

    ((CMainSheet*)m_pMainSheet)->doSomeFunction();



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