Problem with CPropertySheet class
-
Hi, I've got some Problems with CPropertySheet in the development of a C++ application in emVC++. Problem is: I have a PropertySheet width 4 pages (all same size 260*92); but they all get cut of at the right side. So I startet do derive a class from CPropertySheet and overwrite the OnInit Method like in this project: Free size and extended styles in CPropertySheets This brought me a few Problems: - the
CPropertyPage* pppg = GetActivePage();
causes access violation so I changed it intoCPropertyPage* pppg = GetPage(0);
(curious from outside, in the dialog class i can use GetActivePage(), inside I only get a 0x0 pointer) - also thepppg->MapDialogRect(rcOriginal);
causes access violation and all other Methods that later on uses pppg too. This brings me down to the problem that I cannot read out the PropertyPage size on runtime and have to use fixed values to resize. so only these lines had been left from all the code:BOOL bResult = CPropertySheet::OnInitDialog(); ModifyStyleEx(0, WS_EX_TOOLWINDOW); CRect rcModified; //Tab GetTabControl()->GetWindowRect(rcModified); ScreenToClient(&rcModified); rcModified.right +=50; GetTabControl()->SetWindowPos( NULL, 0,0, rcModified.Width(), rcModified.Height(), SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOACTIVATE ); //Sheet GetWindowRect(rcModified); ScreenToClient(&rcModified); rcModified.right +=50; SetWindowPos( NULL, 0,0, rcModified.Width(), rcModified.Height(), SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOACTIVATE );
Anyone has an idea why I cannot acces the ActivePage() or also the work with the PropertyPage reference loaded by GetPage(0) causes access violations?