//建立mfc对话框,然后在ok中加事件
void CEg2Dlg::OnOK()
{
// TODO: Add extra validation here
CFont font;
font.CreatePointFont(200,"Arial");
GetDlgItem(IDC_STATIC)->SetWindowText("Hello vc++");
GetDlgItem(IDC_STATIC)->SetFont(&font);
//CDialog::OnOK();
}
======
//再看常量与变量
//常量是不可改变的,但
#i nclude <iostream>
#i nclude <string>
using namespace std;
void main()
{
const int MAX=10;
*(int*)&MAX=5;
cout<<MAX<<endl;
}
========
//常量是不可改变的,但
#i nclude <iostream>
#i nclude <string>
using namespace std;
void main()
{
const int MAX=10;
*(int*)&MAX=5; //间常修改常量
int var = *(int*)&MAX;
cout<<var<<endl;
cout<<MAX<<endl;
}
===========