在MFC与ACE混合编程时,我要在ACE的ACE_Task线程里向MFC主窗口发消息
int WL_AS_ServerTask::svc(void)
{
//1
PostMessage(AfxGetMainWnd()->GetSafeHwnd(),ID_MESSAGE_REFRESH_SERVER,0,0);
//2
//AfxGetMainWnd()-> PostMessage(ID_MESSAGE_REFRESH_SERVER,0,0);
return 0;
}
使用第一种,主窗口接收不到消息;
使用第二种,出错,Debug出错在afxwin2.inl文件的
#pragma pop_macro("SendMessage")
_AFXWIN_INLINE BOOL CWnd: PostMessage(UINT message, WPARAM wParam, LPARAM lParam)
{ ASSERT(::IsWindow(m_hWnd)); return : PostMessage(m_hWnd, message, wParam, lParam); }
请问到底该如何postmessage?:o |