执行到ScreenToClient出错
LRESULT CRsizeableTestView::HandleInitDialog(WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = CBCGPFormView::HandleInitDialog(wParam, lParam);
UpdateData(FALSE);
CRect rectPropSheet;
m_wndPropSheetPlaceHolder.GetWindowRect(rectPropSheet);
ScreenToClient(rectPropSheet);
m_wndPropSheet.EnableVisualManagerStyle();
m_wndPropSheet.EnableLayout();
m_wndPropSheet.m_bIsAutoDestroy = FALSE;
....
}
是因为m_wndPropSheetPlaceHolder应该是关联一个控件ID。却没有关联。
void CRsizeableTestView::DoDataExchange(CDataExchange* pDX)
{
CBCGPFormView::DoDataExchange(pDX);
DDX_Control(pDX, IDC_PROPSHEET_PLACEHOLDER, m_wndPropSheetPlaceHolder);// 即这一行。
}