|
-
December 2nd, 2009, 11:16 AM
#16
Re: [MFC] DDX/DDV and DoDataExchange between nested PropertySheets
You still haven't answer my questions:
 Originally Posted by VictorN
What exactly are you trying to achieve with the sheet resizing and what do all these magic numbers (10, 15) mean?
Besides, your code has memory leaks (at least in the case of m_poPropSheet->Create(...) fails...
 Originally Posted by npuleio
Code:
BOOL CMyDialogDlg::OnInitDialog()
{
CDialog::OnInitDialog();
...
// Extra initialization here
m_poPropSheet = new CPropertySheet();
pageConfig = new CPage_Config( m_poPropSheet );
m_poPropSheet->AddPage(pageConfig);
DWORD dwStyle = WS_VISIBLE | WS_CHILD;
DWORD dwExStyle = WS_EX_LEFT|WS_EX_CONTROLPARENT;
if ( !m_poPropSheet->Create(this, dwStyle, dwExStyle) )
{
DestroyWindow();
return FALSE;
}
...
return TRUE; // return TRUE unless you set the focus to a control
}
Why do you create this property sheet in the heap? 
Just declare the CPropertySheet instance, NOT a pointer, then create it...
Code:
// in the header:
protected:
HICON m_hIcon;
CPropertySheet m_PropSheet;
// in the .cpp:
if ( !m_PropSheet.Create(this, dwStyle, dwExStyle) )
{
DestroyWindow();
return FALSE;
}
The same - for the property pages.
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|