为什么会报错,在线等!!!
我在一对话框应用程序中有二个RICH和一个LIST,目的是在窗口大小改变后,这三个控件大小也随之改变,程序如下:
void CNQCDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
RECT pRect,pInfo,pSend,pList;//第二、三个为RICH,第四个为LIST
this->GetClientRect(&pRect);
pInfo.left=pRect.left;
pInfo.top=pRect.top;
pInfo.bottom=(pRect.bottom-pRect.top)*6/10;
pInfo.right=(pRect.right-pRect.left)*6/10;
pSend.top=pInfo.bottom+50;
pSend.right=pInfo.right;
pSend.bottom=pRect.bottom;
pSend.left=pRect.left;
pList.left=pInfo.right+2;
pList.bottom=pRect.bottom;
pList.right=pRect.right;
pList.top=pRect.top;
//以下m打头的变量为三个控件变量
m_pInfo.MoveWindow(&pInfo,TRUE);//这以下三个会报错
m_pSend.MoveWindow(&pSend,TRUE);//说什么winocc.cpp的279行出错!
m_pUser.MoveWindow(&pList,TRUE);//为什么?
}