アプリ内で、別のスレッドからダイアログにメッセージを送信したいと考えています。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;
}
std::string the_exception.error_string()
using PostMessage を渡すことも問題ないと思います。