BOOL CSSD::verify(CString email) { if (LoadFromReg() && CheckValidate()) return TRUE; BOOL bRet = FALSE; CDlgOptReg dlg; if (dlg.DoModal() == IDOK) { switch(dlg.m_nOption) { case 0: if (LoadFromDlg() && CheckValidate()) bRet = TRUE; break; case 1: if (DlgLoadFromFile() && CheckValidate()) bRet = TRUE; break; case 2: if (DlgSendForKey(email)) bRet = FALSE; break; default: bRet = FALSE; break; } SaveToReg(); } return bRet; }
BOOL CSSD::LoadFromDlg() { CWnd* pParentWnd = AfxGetMainWnd(); CDlgUsrReg dlg(pParentWnd); dlg.m_User = m_ssd; if (dlg.DoModal() == IDOK) { m_ssd = dlg.m_User; SaveToReg(); if (CheckValidate()) return TRUE; else AfxMessageBox(_T("This is a invalid key")); } return FALSE; }
void CstarterDlg::OnBnClickedOk() { UpdateData(TRUE); char resx[64]; m_cbResolution.GetWindowText(resx, 64); if( !IsValidResolution( resx ) ) { MessageBox( "Please enter a valid resolution.", "Error" ); return; } char *x = strchr( resx, 'x' ); *x = 0; char *resy = x+1; int windowed = m_bFullscreen.GetCheck() == 0 ? 1 : 0; char mapname[64]; m_cbMap.GetWindowText(mapname, 64); char nickname[32]; m_eNickname.GetWindowText(nickname, 32); std::ostringstream params; params << "-resx=" << resx << " -resy=" << resy << " -windowed=" << windowed << " -map=" << mapname << " -name=\"" << nickname << "\""; char chIP[64] = ""; if( m_iConnectChoice == 1 ) { m_eIP.GetWindowTextA( chIP, 63 ); params << " -ip=" << chIP; } SaveToReg(); ShellExecute( NULL, "open", "deferred.exe", params.str().c_str(), NULL, SW_SHOWNORMAL ); CDialogEx::OnOK(); }