【发布时间】:2010-11-22 10:54:45
【问题描述】:
在我的应用程序中,我想从不同的线程向对话框发送消息。 我想将 std::exception 派生类引用传递给对话框。
类似这样的:
try {
//do stuff
}
catch (MyException& the_exception) {
PostMessage(MyhWnd, CWM_SOME_ERROR, 0, 0); //send the_exception or the_exception.error_string() here
}
我想在我的对话框中接收消息并显示the_exception.error_string()中的错误
LPARAM CMyDlg::SomeError(WPARAM, LPARAM)
{
show_error( ?????
return 0;
}
我猜,使用 PostMessage 传递 std::string the_exception.error_string() 也可以。
【问题讨论】:
标签: c++ multithreading mfc postmessage cdialog