::SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)pDlg); pDlg = (CWindowBase *)::GetWindowLongPtr(hWnd, GWL_USERDATA);