Re: PostMessage from thread to PropertyPage and MessageBox
Sorry.. The previous post is incomplete. After successful login in the
Login dialog, I do
CWiFi* wi = new CWiFi;
CWinThread *pThread = AfxBeginThread(WifiThread,wi) ; //
Starting the thread here.
// Open the next dialog based on successful registration.
Control = new CPropertySheetCtrl(L"ImSmartFone"); //
Initialising the PropertySheet here
pDialApp->pSheetCtrl = Control;
Control->m_psh.dwFlags |= PSH_NOAPPLYNOW;
int nResponse = Control->DoModal(); // DoModal on
PropertySheet here.
// Close the client
EndDialog(nResponse); // Closing the Login dialog once
user closes the PropertySheet.
// OnMyMessage1 :: WifiThread exits by posting a message when WiFi
connect
// This is my message handler code.
LRESULT CDialDlg::OnMyMessage1(UINT wParam, LONG lParam)
{
MessageBox(L"Network Connectivity Lost.\nPlease connect to
Wifi and launch ImSmartFone again",L"Error",MB_TOPMOST|MB_OK|
MB_APPLMODAL);
PostQuitMessage(0);
return 0; // I handled this message
}
All this code is in Login dialog's class. Can anybody help me now
Regards,
Triveni