Created
March 24, 2018 07:33
-
-
Save wjx0912/3aa6e06633a6932c712cbfd42e53b32c to your computer and use it in GitHub Desktop.
c++ message object management 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// send | |
PostMessage(MyhWnd, CWM_SOME_ERROR, 0, reinterpret_cast<LPARAM>(new string(the_exception.error_string)) ); | |
// receive | |
LPARAM CMyDlg::OnMyMessage1(WPARAM, LPARAM lParam) | |
{ | |
// Put in shared_ptr so it is automatically destroyed. | |
shared_ptr<string> msg = reinterpret_cast<string*>(lParam); | |
// Do stuff with message | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment