Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How about the CPropertyPage OnOK ? [modified]

How about the CPropertyPage OnOK ? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wangningyu
    wrote on last edited by
    #1

    Hello everybody ! this is a SDI Project,in the toolbar,there are two button,it used to show different dialog.

    class CTestView;

    void CTestView::OnShowDlgA()
    {
    // TODO: Add your command handler code here
    CPropertySheet sheet(_T("TestDlgA"));
    CTestDlgA dlg;

    sheet.AddPage(&dlg);
    if(IDOK == sheet.DoModal())
    {
    	// do something.
    }
    

    }

    void CTestView::OnShowDlgB()
    {
    // TODO: Add your command handler code here
    CPropertySheet sheet(_T("TestDlgB"));
    CTestDlgB dlg;

    sheet.AddPage(&dlg);
    if(IDOK == sheet.DoModal())
    {
    	// do something.
    }
    

    }

    class CTestDlgA : public CPropertyPage
    {
    // ...
    }

    // add the virtual function
    void CTestDlgA ::OnOK()
    {
    // when is false,it will return ,and then end the dialog.
    // I don't want it closed.
    if( !SaveParams() )
    return;

    EndDialog(IDOK);
    //CPropertyPage::OnOK();
    

    }

    class CTestDlgB : public CPropertyPage
    {
    // ...
    }

    // add the virtual function
    void CTestDlgB ::OnOK()
    {
    // usually, this dialogB doesn't closed when is false.
    // but the dialogA is closed at this.
    if( !SaveParams() )
    return;

    EndDialog(IDOK);
    //CPropertyPage::OnOK();
    

    }

    Why will appear this kind of circumstance? Thanks for your reply ! Best Regards !

    modified on Wednesday, May 11, 2011 3:34 AM

    L M D 3 Replies Last reply
    0
    • W wangningyu

      Hello everybody ! this is a SDI Project,in the toolbar,there are two button,it used to show different dialog.

      class CTestView;

      void CTestView::OnShowDlgA()
      {
      // TODO: Add your command handler code here
      CPropertySheet sheet(_T("TestDlgA"));
      CTestDlgA dlg;

      sheet.AddPage(&dlg);
      if(IDOK == sheet.DoModal())
      {
      	// do something.
      }
      

      }

      void CTestView::OnShowDlgB()
      {
      // TODO: Add your command handler code here
      CPropertySheet sheet(_T("TestDlgB"));
      CTestDlgB dlg;

      sheet.AddPage(&dlg);
      if(IDOK == sheet.DoModal())
      {
      	// do something.
      }
      

      }

      class CTestDlgA : public CPropertyPage
      {
      // ...
      }

      // add the virtual function
      void CTestDlgA ::OnOK()
      {
      // when is false,it will return ,and then end the dialog.
      // I don't want it closed.
      if( !SaveParams() )
      return;

      EndDialog(IDOK);
      //CPropertyPage::OnOK();
      

      }

      class CTestDlgB : public CPropertyPage
      {
      // ...
      }

      // add the virtual function
      void CTestDlgB ::OnOK()
      {
      // usually, this dialogB doesn't closed when is false.
      // but the dialogA is closed at this.
      if( !SaveParams() )
      return;

      EndDialog(IDOK);
      //CPropertyPage::OnOK();
      

      }

      Why will appear this kind of circumstance? Thanks for your reply ! Best Regards !

      modified on Wednesday, May 11, 2011 3:34 AM

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Please edit your message and add <pre></pre> tags around your code so it is readable.

      The best things in life are not things.

      W 1 Reply Last reply
      0
      • L Lost User

        Please edit your message and add <pre></pre> tags around your code so it is readable.

        The best things in life are not things.

        W Offline
        W Offline
        wangningyu
        wrote on last edited by
        #3

        :-D

        1 Reply Last reply
        0
        • W wangningyu

          Hello everybody ! this is a SDI Project,in the toolbar,there are two button,it used to show different dialog.

          class CTestView;

          void CTestView::OnShowDlgA()
          {
          // TODO: Add your command handler code here
          CPropertySheet sheet(_T("TestDlgA"));
          CTestDlgA dlg;

          sheet.AddPage(&dlg);
          if(IDOK == sheet.DoModal())
          {
          	// do something.
          }
          

          }

          void CTestView::OnShowDlgB()
          {
          // TODO: Add your command handler code here
          CPropertySheet sheet(_T("TestDlgB"));
          CTestDlgB dlg;

          sheet.AddPage(&dlg);
          if(IDOK == sheet.DoModal())
          {
          	// do something.
          }
          

          }

          class CTestDlgA : public CPropertyPage
          {
          // ...
          }

          // add the virtual function
          void CTestDlgA ::OnOK()
          {
          // when is false,it will return ,and then end the dialog.
          // I don't want it closed.
          if( !SaveParams() )
          return;

          EndDialog(IDOK);
          //CPropertyPage::OnOK();
          

          }

          class CTestDlgB : public CPropertyPage
          {
          // ...
          }

          // add the virtual function
          void CTestDlgB ::OnOK()
          {
          // usually, this dialogB doesn't closed when is false.
          // but the dialogA is closed at this.
          if( !SaveParams() )
          return;

          EndDialog(IDOK);
          //CPropertyPage::OnOK();
          

          }

          Why will appear this kind of circumstance? Thanks for your reply ! Best Regards !

          modified on Wednesday, May 11, 2011 3:34 AM

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          What is the question?

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          1 Reply Last reply
          0
          • W wangningyu

            Hello everybody ! this is a SDI Project,in the toolbar,there are two button,it used to show different dialog.

            class CTestView;

            void CTestView::OnShowDlgA()
            {
            // TODO: Add your command handler code here
            CPropertySheet sheet(_T("TestDlgA"));
            CTestDlgA dlg;

            sheet.AddPage(&dlg);
            if(IDOK == sheet.DoModal())
            {
            	// do something.
            }
            

            }

            void CTestView::OnShowDlgB()
            {
            // TODO: Add your command handler code here
            CPropertySheet sheet(_T("TestDlgB"));
            CTestDlgB dlg;

            sheet.AddPage(&dlg);
            if(IDOK == sheet.DoModal())
            {
            	// do something.
            }
            

            }

            class CTestDlgA : public CPropertyPage
            {
            // ...
            }

            // add the virtual function
            void CTestDlgA ::OnOK()
            {
            // when is false,it will return ,and then end the dialog.
            // I don't want it closed.
            if( !SaveParams() )
            return;

            EndDialog(IDOK);
            //CPropertyPage::OnOK();
            

            }

            class CTestDlgB : public CPropertyPage
            {
            // ...
            }

            // add the virtual function
            void CTestDlgB ::OnOK()
            {
            // usually, this dialogB doesn't closed when is false.
            // but the dialogA is closed at this.
            if( !SaveParams() )
            return;

            EndDialog(IDOK);
            //CPropertyPage::OnOK();
            

            }

            Why will appear this kind of circumstance? Thanks for your reply ! Best Regards !

            modified on Wednesday, May 11, 2011 3:34 AM

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Koma Wang wrote:

            Why will appear this kind of circumstance?

            This makes no sense. :confused: Please explain.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups