I have a CPropertySheet with three tabs. I have a separate CPropertyPage class for each tab when my CPO Promotions debugger If filled, the first page is always shown correctly. However, when I click on any of the other tabs, the CPropertyPage area is empty even if I first click on the tab, the area is still empty. I use Visual Studio, MFC, C ++ I am using.
I am trying to find the appropriate methods to handle different tab clicks and my tabs are shown correctly This is the code to start my property sheet and its page is:
BOOL CSLIMOptCplusplusApp :: InitInstance () {CWinApp :: InitInstance (); SQLHENV m_1; EnvGetHandle (m_1); Login UN; // Creates a login dialog for the user to enter credentials. Lgn.DoModal (); CImageSheet * imagedlg = new CImageSheet ("Admin Options"); CImage display * page image display = new cius display; CImageDimensions * pageImageDimensions = New CImageDimensions; Listoption * pagelist option = new listoption; Esrest (IFested); Eserat (page imaged display); Ezert (page image dimensions); Esret (pagedist opsion); Imagedlg- & gt; AddPage (pagelist option); Imagedlg- & gt; AddPage (page image); Imagedlg- & gt; AddPage (Page Image Dimensions); Imagedlg- & gt; M_psh.dwFlags | = PSH_NOAPPLYNOW; // Apply default button imagedlg- & gt; Create (); Imagedlg- & gt; ShowWindow (SW_SHOW); M_pMainWnd = Iamated;
This is the code for my CPropertySheet class:
BOOL CImageSheet :: OnInitDialog () {CWnd * pOKButton = GetDlgItem (IDOK); Esaret (pokbutan); Pokbubtons-> Shawwondo (SW_HIDE); CWND * PCNCLatton = Gate Delgietim (idcency); ESerate (PCCLButton); PCANCELButton-> ShowWindow (SW_HIDE); // Flags set for property sheet m_bModeless = TRUE; M_nFlags | = WF_CONTINUEMODAL; BOOL bResult = CPropertySheet :: OnInitDialog (); M_bModeless = FALSE; M_nFlags & amp; = ~ WF_CONTINUEMODAL; // Get the button size and position; GetDlgItem (IDOK) - & gt; GetWindowRect (rect); GetTabControl () - & gt; GetWindowRect (fresh); ScreenTouquant (Rect); ScreenTalicant (fresh); Update Data (FALSE);
Thanks for any help!
Edit:
This is the code for a simple page that I want to show.
// ImageDisplay.cpp: Implementation File // #include "stdafx.h" #include "SLIMOptCplusplus.h" #include "ImageDisplay.h" #include "afxdialogex.h" #include "ListOption.h" // CImage Discplayplay dialog char g_emailProfile [255]; IMPLEMENT_DYNAMIC (CImageDisplay, CPropertyPage) CImageDisplay :: CImageDisplay (): CPropertyPage (CImageDisplay :: IDD), m_EmailProfile (_T (g_emailProfile)) {} CImageDisplay :: ~ CImageDisplay () {} zero CImageDisplay :: DoDataExchange (CDataExchange * pDX) { CPropertyPage :: DoDataExchange (PDX); DDX_Text (PDX, TXTC_EMAIL_PROFILE, m_EmailProfile); } BEGIN_MESSAGE_MAP (CImageDisplay, CPropertyPage) END_MESSAGE_MAP () // CImage display message handlers
My The problem was that I was doing m_bModeless false setting,
BOOL bResult = CPropertySheet :: OnInitDialog (); M_bModeless = FALSE; // Replace TRUE to fix the problem M_nFlags & amp; = ~ WF_CONTINUEMODAL;
No comments:
Post a Comment