我自己做好的界面,想给按钮添加颜色。在我的工程中使用CButtonST类,compile和build都没有错误。只是想改变我界面上按钮的颜色,但是加进去CButtonST类后,编译链接没有错误,但是运行的时候什么都不出现,也不提示任何错误。我单步调试的时候提示:Unhandled exception in XXX.exe:0xc0000005:Access Violation.有谁在自己的工程中使用过CButtonST类?给我指点指点。我按照孙鑫老师的视频教程中做的。
调试欢乐多
先声明m_btnStandard;
void CDlgBasic::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgBasic)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP // Make our buttons a CButtonST buttons
DDX_Control(pDX, IDC_BTNSTANDARD, m_btnStandard);
}
BOOL CDlgBasic::OnInitDialog()
{
CDialog::OnInitDialog(); // Standard button
m_btnStandard.SetIcon(IDI_EOAPP);
m_btnStandard.SetFlat(FALSE); return TRUE;
}