Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - Problem navigating acros pages of a property sheet
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem navigating acros pages of a property sheet

 Post Reply Post Reply
Author
Message
Satyen View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2008
Location: India
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Satyen Quote  Post ReplyReply Direct Link To This Post Topic: Problem navigating acros pages of a property sheet
    Posted: 03 December 2012 at 6:48am
Hello,
 
I have developed a simple dialog application using classes -  CXTPPropertySheet and CXTPPropertyPage.
 
I am adding 5 pages in to the property sheet. Please refer the code. I want to display a modeless dialog so I am using 'Create' and 'ShowWindow' functions.
 
I am not able to navigate to any page other than the fisrt active page. When I click any of the pages first active page always gets displayed.
 
If I create modal dialog (by calling DoModal) then this problem is not seen. Please let me know what might be the reason.
 
Function 'OnInitDialog' of the page I am trying to navigate to gets called. I found that we fail in function 'CXTPPropertyPage::CreatePage' while executing this statement -
 

if (!LoadTemplate(hTemplate, hInstance))

return FALSE;

 
I am not getting the cause. If anybody knows about modeless dilaog using CXTPPropertySheet then please reply on priority.
-------------------------------------- Code  --------------------------------------------------------------
 
JFEAOptimizationMainDlg* m_pOptimizeDlg;

if(NULL == m_pOptimizeDlg)

{

      m_pOptimizeDlg = new JFEAOptimizationMainDlg( this, this);

      if (!m_pOptimizeDlg)

     {

         hr_exit(E_OUTOFMEMORY);

     }

if(m_pOptimizeDlg)

{

         CXTPPropertyPageListNavigator* pList = new CXTPPropertyPageListNavigator();

         pList->SetListStyle(xtListBoxOffice2007);

         m_pOptimizeDlg->SetNavigator(pList);

          m_pOptimizeDlg->SetResizable();

          m_pOptimizeDlg->SetPageSize(CSize(350, 250)); // in dialog units

          // First page is active page.

         m_pOptimizeDlg->SetActivePage(0);

 

              // Add pages.

            m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptObjectivePage);

             m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptLimitsPage);

            m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptVariablesPage);

             m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptCtrlParamPage);

             m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptConvParamPage);

              // Set dialog title.

             utDilaogTitle.LoadStringResource(hInstPrevious, IDS_FEA_OPTIMIZATION_TITLE);

             m_pOptimizeDlg->SetTitle(utDilaogTitle);

             // Show the dialog

          if(!IsWindow(hWnd))

           {

               if (m_pOptimizeDlg->Create(this, WS_SYSMENU | WS_POPUP | WS_CAPTION                           DS_MODALFRAME |         DS_CONTEXTHELP | WS_VISIBLE)

               {

                             m_pOptimizeDlg->ShowWindow(SW_SHOW);

                            m_pOptimizeDlg->UpdateWindow();

               }

           }

          else

          {

                m_pOptimizeDlg->ShowWindow(SW_SHOW);

            }

}

---------------------------------- Code Ends -------------------------------------------------
Thanks & Regards,
Satyenjit Bagal.
Software Development Engineer.
SIEMENS Automation and Drives.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.