一些小问题记录

来源:互联网 发布:landsat的波段数据 编辑:程序博客网 时间:2024/05/19 12:13


1. str.Format("%d",i); 出现错误,记得加t,如str.Format(_t("%d",i);


2.获取MFC中控件,控制区域(窗口)大小

CRect rect,rectDlg;//获取控制区域(窗口)大小GetClientRect(rectDlg);//获取控件大小CWnd *pWnd;pWnd = GetDlgItem(IDC_VIDEO);pWnd->GetWindowRect(&rect);  //显示尺寸CString str;str.Format(_T("控件的宽:%d, 长:%d;窗口的宽:%d, 长:%d"),rect.Width(),rect.Height(),rectDlg.Width(),rectDlg.Height());MessageBox(str);