我用的是 CButtonST做的按钮 为什么我在同一个DLG里面做了2个相同的按钮 编译没有错误 但是运行就不行呢?
BOOL CAaDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_btnStandard[0].SubclassDlgItem(IDC_BUTTON1,this);
m_btnStandard[0].SetIcon(IDI_ICON1);
m_btnStandard[0].SetAlign(CButtonST::ST_ALIGN_VERT);
m_btnStandard[0].DrawFlatFocus(TRUE); m_btnStandard[1].SubclassDlgItem(IDC_BUTTON2,this);
m_btnStandard[1].SetIcon(IDI_ICON2);
m_btnStandard[1].SetAlign(CButtonST::ST_ALIGN_VERT);
m_btnStandard[1].DrawFlatFocus(TRUE);
//Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
} // Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
这个是什么问题啊? 谢谢请教
BOOL CAaDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_btnStandard[0].SubclassDlgItem(IDC_BUTTON1,this);
m_btnStandard[0].SetIcon(IDI_ICON1);
m_btnStandard[0].SetAlign(CButtonST::ST_ALIGN_VERT);
m_btnStandard[0].DrawFlatFocus(TRUE); m_btnStandard[1].SubclassDlgItem(IDC_BUTTON2,this);
m_btnStandard[1].SetIcon(IDI_ICON2);
m_btnStandard[1].SetAlign(CButtonST::ST_ALIGN_VERT);
m_btnStandard[1].DrawFlatFocus(TRUE);
//Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
} // Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
这个是什么问题啊? 谢谢请教
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货