Avoid a "pure call" issue.

This commit is contained in:
Unknown W. Brackets 2013-09-15 10:36:19 -07:00
parent cfb50bf4d6
commit 2251b0dd59
2 changed files with 4 additions and 1 deletions

View File

@ -8,11 +8,13 @@ Dialog::Dialog(LPCSTR res, HINSTANCE _hInstance, HWND _hParent)
m_hInstance = _hInstance;
m_hParent = _hParent;
m_hResource=res;
m_bValid = true;
Create();
}
Dialog::~Dialog()
{
m_bValid = false;
Destroy();
}
@ -38,7 +40,7 @@ void Dialog::Show(bool _bShow)
INT_PTR Dialog::DlgProcStatic(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
Dialog *dis = (Dialog*)GetWindowLongPtr(hdlg, GWLP_USERDATA);
if (dis)
if (dis && dis->m_bValid)
return dis->DlgProc(message,wParam,lParam);
else
{

View File

@ -9,6 +9,7 @@ protected:
HWND m_hParent;
HWND m_hDlg;
LPCSTR m_hResource;
bool m_bValid;
virtual BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{