怎样改变控件的大小?
void CAdo1View::OnSize(UINT nType, int cx, int cy)
{
//COleDBRecordView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
int iHeight,iWidth;
CRect rect;
COleDBRecordView::OnSize(nType,cx,cy);
GetClientRect(rect);
iHeight=rect.Height()/10;
iWidth=rect.Width()/10;
m_adoDC1.MoveWindow(cx/2,cy-iHeight,iWidth,iHeight,TRUE); //第7句
m_dataGrid1.MoveWindow(0,0,cx,cy-iHeight,TRUE);
}
此处的m_adoDC1为一个控件,运行到第7句时程序出错。Debug Assertion Failed!
请教各位!