错误原因:不能多次对一个成员变量button用create.
解决办法:
if(m_wndPushButton.m_hWnd==NULL)
m_wndPushButton.Create(_T("监视/暂停"),WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,rect,this,IDC_BUTTON);
建议:
CFont font[4];
struct Font_Type
{
int size;
char *type;
};
int num=sizeof(font)/sizeof(CFont);
Font_Type ft[sizeof(font)/sizeof(CFont)]=
{
520,"隶书",
220,"楷书",
180,"隶书",
120,"楷书"
};
for(int i=0;i<num;i++)
font[i].CreatePointFont(ft[i].size,ft[i].type);