15,473
社区成员




//定义的线程信息结构体
struct struct_MyInfo
{
......
CStatusBar *statusBar;
};
//对话框中OnInitDialog()
BOOL CXXXDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
......
theApp.m_statusBar.SetPaneText(0, L"正在获取版本信息...");//<---这里没事
struct_MyInfo *p = new struct_MyInfo;
......
p->statusBar = &(theApp.m_statusBar);//<---m_statusBar我是定义在App中的
CWinThread *pThread = AfxBeginThread(MyThread, (LPVOID)p);
......
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
//线程
UINT MyThread(LPVOID lpParam)
{
struct_MyInfo *p = (struct_MyInfo *)lpParam;
......
p->statusBar->SetPaneText(0, L"就绪");//<---就这里会崩溃
return 0;
}