取得主窗口指针
AfxGetMainWnd()

Code
AfxGetMainWnd()->m_hWnd;//主窗口句柄
AfxGetMainWnd()->CenterWindow();//使窗口居中
AfxGetMainWnd()->ShowWindow(SW_MAXIMIZE);//最大化窗口,这里的ShowWindow是CWnd的成员函数
也可以写成
::ShowWindow(AfxGetMainWnd()->m_hWnd,SW_MAXIMIZE);// 这里的ShowWindow是windows API
Format()
该函数是CString类的函数,用来把数据转换成CString类型的字符串,转换后的字符串就存放在调用该Format函数的CString类对象中。
使用Format函数时,可以通过格式符选择吧数据转换为何种进制下的数字字符串:
o表示8进制 x表示十六进制 d表示十进制

Code
int value=100;
str.Format("%o",value);
str.Format("%x",value);//对于十六进制 大写的X输出大写的十六进制数
m_Edit1=str;
m_Edit2=str;
UpdateData(FALSE);