VS2010 Ribbon之状态栏问题
相门三少 2018-12-18 03:21:13 我在Mainframe中定义了一个函数,用来更新状态信息
void CMainFrame::UpdateStatusInfo(int mIndex, char* strText)
{
CMFCRibbonBaseElement *pElement;
//pFrame->m_wndStatusBar.GetElement(0)->SetText(info);
pElement = m_wndStatusBar.GetElement(mIndex);
if(!pElement)
{
MessageBox("NULL Pointer");
return;
}
pElement->SetText(strText);
pElement->Redraw();
}
然后在一个线程中去调用这个函数
CMainFrame *pMain=(CMainFrame *)AfxGetApp()->m_pMainWnd;
pMain->UpdateStatusInfo(0,“testing”);
然后我发现用Debug版本运行会出错,Release版本就一切正常。