::SetWindowPos(GetDlgItem(IDC_LIST1)->GetSafeHwnd(), wndTop, rectList.left+5, rectList.top+64,rectList.Width()-9, rectList.Height()-69, SWP_NOMOVE);
GetDlgItem(IDC_LIST1)->SetWindowPos( &wndTop, rectList.left+5, rectList.top+64,rectList.Width()-9, rectList.Height()-69, SWP_NOMOVE);
这两条的运行结果怎么不一样,上面这条显示正常,下面这条一运行就告诉你“某某内存不能读”,MFC不是这样用的吗?
GetDlgItem(IDC_LIST1)->SetWindowPos( &wndTop, rectList.left+5, rectList.top+64,rectList.Width()-9, rectList.Height()-69, SWP_NOMOVE);
这两条的运行结果怎么不一样,上面这条显示正常,下面这条一运行就告诉你“某某内存不能读”,MFC不是这样用的吗?
GetDlgItem(IDC_LIST1)->SetWindowPos( &CWnd::wndTop, rectList.left+5, rectList.top+64,rectList.Width()-9, rectList.Height()-69, SWP_NOMOVE);
GetDlgItem(IDC_LIST1)->SetWindowPos( &wndTop, rectList.left+5, rectList.top+64,rectList.Width()-9, rectList.Height()-69, SWP_NOMOVE);
不能在重载的OnSize( UINT nType, int cx, int cy )函数中执行,在此函数中运行GetDlgItem(IDC_LIST1)->GetClientRect(rect);和
GetDlgItem(IDC_LIST1)->GetWindowRect(rect);也会出错,在其他函数中运行就没有问题,OnSize( UINT nType, int cx, int cy )函数有什么不一样吗?
GetDlgItem(IDC_LIST1)->SetWindowPos( &wndTop, rectList.left+5, rectList.top+64,rectList.Width()-9, rectList.Height()-69, SWP_NOMOVE);
不能在重载的OnSize( UINT nType, int cx, int cy )函数中执行,在此函数中运行GetDlgItem(IDC_LIST1)->GetClientRect(rect);和
GetDlgItem(IDC_LIST1)->GetWindowRect(rect);也会出错,在其他函数中运行就没有问题,OnSize( UINT nType, int cx, int cy )函数有什么不一样吗?