BOOL CPasswordApp::InitInstance()
{
	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	CPasswordDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}
Пример #2
0
void CMainDlg::OnScheduleEdit()
{
	CPasswordDlg PasswordDlg;

	if (!m_bVerified)
	{
		PasswordDlg.m_bSetPassword = FALSE;
		if (IDOK != PasswordDlg.DoModal())
			return;
		m_bVerified = TRUE;
	}
	g_nSelItem = 0;
	ShowPage(3);
	m_FileList.ShowWindow(SW_HIDE);
	m_wndToolBar.GetToolBarCtrl().EnableButton(ID_SEC_DELETE,FALSE); 
	EnableMenu(1,FALSE);
	::SendMessage(m_pStep3->m_hWnd,WM_REFRESH_ITEM,0,0);
}
Пример #3
0
void CBaseConfigPage::OnBnClickedOk()
{
    CPasswordDlg dlg;
	 int iRetrunID=dlg.DoModal();
	 if(iRetrunID==IDCANCEL)
		 return;

	if(!dlg.IsPSWRgiht())
	
	{
       MessageBox("Wrong Password!");
	   return;
	}
	
     CString strDllPathName;
	 CString strDllLossFileName;
	 char szTemp[1024];
	_TCHAR _tKeyName[1000]={0};
	_TCHAR _TSectionName[1000]={0};
	_TCHAR _tKeyValue[1000];
	CString strTemp;
	int iCtrlIDIndex=0;
	CString strChannel;
	CString striLoss;
    
	
	 if(m_listProcessEnable.GetCount()==0)
	 {
      AfxMessageBox("ProcesslistEnable can not be NULL");
	  return;
	 }
	
     
	::GetModuleFileName(NULL, szTemp, _MAX_PATH);

	  
	  strDllPathName.Format("%s",szTemp);
     strDllPathName = strDllPathName.Left(strDllPathName.ReverseFind(_T('\\')));

	strDllPathName=strDllPathName+_T("\\SystemConfig\\SystemSetup.ini");
	
	if(fopen(strDllPathName,"r")==NULL)
	{
        CString strTemp=strDllPathName+_T("  not exist");
		AfxMessageBox(strTemp);
		return ;
	}

	
	GetDlgItemText(IDC_FILESEQPATH,strTemp);
	::WritePrivateProfileString(_T("File Path"),_T("SequencePath"),strTemp,strDllPathName);
    GetDlgItemText(IDC_LOGPATH,strTemp);
   ::WritePrivateProfileString(_T("File Path"),_T("LogPath"),strTemp,strDllPathName);

      GetDlgItemText(IDC_DIAGPORT,strTemp);
	  strTemp=strTemp.Right(strTemp.GetLength()-3);
   ::WritePrivateProfileString(_T("Settings"),_T("PhoneComport"),strTemp,strDllPathName);

      GetDlgItemText(IDC_ATPORT,strTemp);
	  strTemp=strTemp.Right(strTemp.GetLength()-3);
   ::WritePrivateProfileString(_T("Settings"),_T("ATComport"),strTemp,strDllPathName);

    GetDlgItemText(IDC_LOOPCOUNT,strTemp);
	 
   ::WritePrivateProfileString(_T("Settings"),_T("LoopCount"),strTemp,strDllPathName);

    GetDlgItemText(IDC_WAITCOM,strTemp);
	strTemp=strTemp.Left(strTemp.GetLength()-2);
   ::WritePrivateProfileString(_T("Settings"),_T("PhoneOpenPortRetryTime"),strTemp,strDllPathName);

      GetDlgItemText(IDC_TESTSET,strTemp);
   
   ::WritePrivateProfileString(_T("Settings"),_T("TesterDeviceCommon"),strTemp,strDllPathName);

    GetDlgItemText(IDC_TESTSET1,strTemp);
   
   ::WritePrivateProfileString(_T("Settings"),_T("TesterDevice1"),strTemp,strDllPathName);

      GetDlgItemText(IDC_PLY,strTemp);
   
   ::WritePrivateProfileString(_T("Settings"),_T("PowerSupplyCommon"),strTemp,strDllPathName);

    GetDlgItemText(IDC_PLY1,strTemp);
   
   ::WritePrivateProfileString(_T("Settings"),_T("PowerSupply1"),strTemp,strDllPathName);


      GetDlgItemText(IDC_FREQMEAS,strTemp);
   
   ::WritePrivateProfileString(_T("Settings"),_T("FreqMeasDevice"),strTemp,strDllPathName);

    GetDlgItemText(IDC_MULMEAS,strTemp);
   
   ::WritePrivateProfileString(_T("Settings"),_T("MulMeasDevice"),strTemp,strDllPathName);


      GetDlgItemText(IDC_GPIBADDR,strTemp);
   
    ::GetPrivateProfileString(_T("Settings"),_T("Device_Addr"),NULL,_tKeyValue,sizeof(_tKeyValue),strDllPathName);
    CString str=_tKeyValue;  
	int iIndex=str.Find("::");
	CString str1=str.Left(iIndex+2);
	int iIndex2=str.Find("::",iIndex+1);
	CString str2=NULL;
	
	if (iIndex2>-1)
	{
		iIndex=str.GetLength() - str.Find("::",iIndex+1);
		str2=str.Right(iIndex);
	}

	
    str=str1+strTemp+str2;
   ::WritePrivateProfileString(_T("Settings"),_T("Device_Addr"),str,strDllPathName);

     GetDlgItemText(IDC_GPIBADDR1,strTemp);
   
    ::GetPrivateProfileString(_T("Settings"),_T("Device_Addr1"),NULL,_tKeyValue,sizeof(_tKeyValue),strDllPathName);
    str=_tKeyValue;   
	iIndex=str.Find("::");
	str=str.Left(iIndex+2);
    str+=strTemp;
   ::WritePrivateProfileString(_T("Settings"),_T("Device_Addr1"),str,strDllPathName);

      GetDlgItemText(IDC_GPIBADDRPLY,strTemp);
   
    ::GetPrivateProfileString(_T("Settings"),_T("Device_AddrPly"),NULL,_tKeyValue,sizeof(_tKeyValue),strDllPathName);
    str=_tKeyValue;   
	iIndex=str.Find("::");
	str=str.Left(iIndex+2);
    str+=strTemp;
   ::WritePrivateProfileString(_T("Settings"),_T("Device_AddrPly"),str,strDllPathName);

     GetDlgItemText(IDC_GPIBADDRPLY1,strTemp);
   
    ::GetPrivateProfileString(_T("Settings"),_T("Device_AddrPly1"),NULL,_tKeyValue,sizeof(_tKeyValue),strDllPathName);
    str=_tKeyValue;   
	iIndex=str.Find("::");
	str=str.Left(iIndex+2);
    str+=strTemp;
   ::WritePrivateProfileString(_T("Settings"),_T("Device_AddrPly1"),str,strDllPathName);


     GetDlgItemText(IDC_FREQADDR,strTemp);
   
    ::GetPrivateProfileString(_T("Settings"),_T("FreqMeasAddr"),NULL,_tKeyValue,sizeof(_tKeyValue),strDllPathName);
     str=_tKeyValue;   
    iIndex=str.Find("::");
	str=str.Left(iIndex+2);
    str+=strTemp;
   ::WritePrivateProfileString(_T("Settings"),_T("FreqMeasAddr"),str,strDllPathName);

    GetDlgItemText(IDC_MULMEASADDR,strTemp);
   
    ::GetPrivateProfileString(_T("Settings"),_T("MulMeasAddr"),NULL,_tKeyValue,sizeof(_tKeyValue),strDllPathName);
    str=_tKeyValue;   
	 iIndex=str.Find("::");
	str=str.Left(iIndex+2);
    str+=strTemp;
   ::WritePrivateProfileString(_T("Settings"),_T("MulMeasAddr"),str,strDllPathName);


     GetDlgItemText(IDC_PLYPORT,strTemp);
   
   ::WritePrivateProfileString(_T("Settings"),_T("PowerSupplyPort"),strTemp,strDllPathName);

      GetDlgItemText(IDC_PLYPORT1,strTemp);
   
   ::WritePrivateProfileString(_T("Settings"),_T("PowerSupply1Port"),strTemp,strDllPathName);



    
   int iCheck=((CButton*)GetDlgItem(IDC_SFCTRL))->GetCheck();
   ::WritePrivateProfileString(_T("Settings"),_T("IsDoSF"),CStr::IntToStr(iCheck),strDllPathName);

      iCheck=((CButton*)GetDlgItem(IDC_DB))->GetCheck();
   ::WritePrivateProfileString(_T("Settings"),_T("IsDoDB"),CStr::IntToStr(iCheck),strDllPathName);
    
   iCheck=((CButton*)GetDlgItem(IDC_STOPFAIL))->GetCheck();

   ::WritePrivateProfileString(_T("Settings"),_T("StopWhenFail"),CStr::IntToStr(iCheck),strDllPathName);

    iCheck=((CButton*)GetDlgItem(IDC_RUNSN))->GetCheck();

   ::WritePrivateProfileString(_T("Settings"),_T("RunAfterSN"),CStr::IntToStr(iCheck),strDllPathName);

   
   
       
		  theApp.m_vProcessListEnable.clear();
		  for(int i=0;i<m_listProcessEnable.GetCount();++i)
		  {
			  m_listProcessEnable.GetText(i,strTemp);
			  theApp.m_vProcessListEnable.push_back(strTemp);
		  }
     if(m_bChangeProcess)
     theApp.UpdateXMLProcessList();

	 theApp.ParseSystemIni();
	 theApp.MainPageLoadIniUpdateUI();

	 LRESULT lr;
	((CTabCtrl*)GetParent())->SetCurSel(0);
	 ((CSimRFDlg*)AfxGetMainWnd())->OnTcnSelchangeTab4(0,&lr);
     
}
Пример #4
0
void CClientDlg::OnBnClickedJoin()
{
	m_pBtnJoin.EnableWindow(FALSE);
	POSITION pos = m_pServerList.GetFirstSelectedItemPosition();
	if (pos == NULL) return;
	
	u32 nItem = (u32) m_pServerList.GetNextSelectedItem(pos);
	if (nItem < 0 || nItem >= net_Hosts.size()) return;

	int iCatchInput = 0;
	int NameLen = 0;
	int iPrefetch = 0;
	int iR2 = 0;
	int iDistort = 1;
	char sLogsPath[1024] = "";
	char Name[1024];
	char NameAdd[1024];
	char sCDKeyStr[1024] = "";
	CStalker_netDlg* pMainDlg = (CStalker_netDlg*) (GetParent()->GetParent());
	if (pMainDlg)
	{
		iCatchInput = pMainDlg->m_pCatchInput.GetCheck();
		NameLen = pMainDlg->m_pPlayerName.GetWindowTextLength();
		if (NameLen) 
		{
			pMainDlg->m_pPlayerName.GetWindowText(Name, 1023);
			Name[32]=0;
			sprintf(NameAdd, "/name=%s", Name);
		};
		iPrefetch  = pMainDlg->m_pPrefetch.GetCheck();
		iR2 = pMainDlg->m_pR2.GetCheck();
		iDistort = pMainDlg->m_pDistort.GetCheck();
		if (pMainDlg->m_pLogsPath.GetWindowTextLength() != 0)
		{
			char tmp[1024];
			pMainDlg->m_pLogsPath.GetWindowText(tmp, 1024);
			sprintf(sLogsPath, "-overlaypath %s ", tmp);
		}
		if (pMainDlg->m_pCDKeyBtn.GetWindowTextLength() != 0)
		{
			char tmp[1024];
			pMainDlg->m_pCDKeyBtn.GetWindowText(tmp, 1024);
			if (0 != xr_strcmp(tmp, "- No CD Key -"))
				sprintf(sCDKeyStr, "/cdkey=%s", tmp);
		}
	};

	//-noprefetch
	char cmdline[1024];
	HOST_NODE	N = net_Hosts[m_pServerList.GetItemData(nItem)];
	char	PortStr[1024];
	if (N.dpPort != 0)
	{
		sprintf(PortStr, "/port=%d", N.dpPort);
	}

	char PswStr[1024] = "";
	if (N.dpPassword != 0)
	{
		CPasswordDlg dlg;
		char Psw[64];
		INT_PTR nResponse = dlg.DoModal(Psw);
		if (nResponse == IDOK)
		{
			sprintf(PswStr, "/psw=%s", Psw);
		};
		if (nResponse == IDCANCEL) return;
	};	
	/* Server(%s/deathmatch)*/ 
	sprintf(cmdline, "xr_3da.exe -xclsx %s%s%s%s%s %s -nocache -external -start client(%s%s%s%s%s)", //server/name
							(iCatchInput == 1) ? "-i " : "",
							(iPrefetch == 1) ? "" : "-noprefetch ",
							(iR2 == 1) ? "-r2" : "",
							(iDistort == 1) ? "" : "-nodistort",
							(sLogsPath[0] == 0) ? "" : sLogsPath,
							//-------------------------------------
							LTX, 
							//-------------------------------------
///							N.dpSessionName,
							N.dpHostName,//N.dpServerName,
							(NameLen) ? NameAdd : "",
							(N.dpPort!=0) ? PortStr : "",
							(N.dpPassword != 0) ? PswStr : "",
							(sCDKeyStr[0]) ? sCDKeyStr : ""
							);

	OutputDebugString( cmdline );
	int res = WinExec(cmdline, SW_SHOW);
}