1.CWnd
1.1.UpdateData()
作用:
UpdateData() and Updatedata(TRUE) are the same.
UpdateData(TRUE) is used to copy the contents of the controls into the associated variables.
UpdateData(FALSE) is used to put the values in the variables to the associated controls.
1.2CString
1.2.1Format 与printf()类似
void Format( LPCTSTR lpszFormat, ... ); void Format( UINT nFormatID, ... );
例:
CString str = "Some Data";str.Format("%s%d", str, 123); //%s 字符串,%d有符号十进制,%u无符号十进制,%o八进制
1.3 MFC集合类 :
CArray: template< class TYPE, class ARG_TYPE > class CArray : public CObject
注意:其可以自动分配和删除内存
(1)Add(i):返回添加后元素的index
// example for CArray::Add ---引用自msdnCArrayptArray;CPoint pt(10,20);ptArray.Add(pt); // Element 0ptArray.Add(CPoint(30,40)); // Element 1
(2)Get(i)给出给定索引值的数据
(3)GetSize()获得元素的数量
(4)IsEmpty()判断是否为空 (5)Insert()在指定位置插入