Ejemplo n.º 1
0
void CGpsdoDownload::LoadSetting()
{
	CRegistry reg;
	reg.SetRootKey(HKEY_CURRENT_USER);
	if(reg.SetKey("Software\\GNSSViewer\\GPS", true))
	{
		m_strMasterPath = reg.ReadString("gpsdo_fw_dn_master_path", "");
		m_strSlavePath = reg.ReadString("gpsdo_fw_dn_slave_path", "");
	}
}
Ejemplo n.º 2
0
//=======================================================================================
// FUNCTION	: 동부DRCM의 정보를 레지스트리에서 가져옴
// RETURN	: 
//=======================================================================================
BOOL CDongbuAPIClientDlg::GetDRCMInfo(CString &szRoot, CString &szExe, CString &szWinName )
{	
	CRegistry registry;
	registry.SetRootKey(HKEY_CURRENT_USER);
	registry.SetKey("Software\\Dongbu Securities\\DongbuDRCM\\PATH", FALSE);
	szRoot = registry.ReadString("Root", "");
	szExe = registry.ReadString("Exe", "");
	szWinName = registry.ReadString("WinName", "");

	if ( szRoot.IsEmpty() || szExe.IsEmpty() || szWinName.IsEmpty())
		return FALSE ;
	else
		return TRUE ;
}
Ejemplo n.º 3
0
BOOL CHostBaseDownloadDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	CComboBox* baudrateCombo = (CComboBox*)GetDlgItem(IDC_BAUDRATE_IDX);
	CComboBox* bufferCombo = (CComboBox*)GetDlgItem(IDC_BUFFER_IDX);

  g_setting.InitBaudrateCombo(baudrateCombo);
	baudrateCombo->AddString("SPI");

	CRegistry reg;
	reg.SetRootKey(HKEY_CURRENT_USER);
	if(reg.SetKey(VIEWER_REG_PATH, TRUE))
	{
		m_nBaudrateIdx = reg.ReadInt("hb_baudrate", g_setting.boostBaudIndex);
		m_strPath = reg.ReadString("hb_firmware", "");
		m_nBufferIdx = reg.ReadInt("hb_buffer", 0);
	}
	else
	{
		m_nBaudrateIdx = BAUDRATE_DEFAULT;
	}

	if(m_strPath.IsEmpty())
	{
		m_strPath = theApp.GetCurrrentDir();
		m_strPath += "\\host.bin";
	}

	baudrateCombo->SetCurSel(m_nBaudrateIdx);
	GetDlgItem(IDC_IMG_PATH)->SetWindowText(m_strPath);
	bufferCombo->SetCurSel(m_nBufferIdx);

	return TRUE;  // return TRUE unless you set the focus to a control
}
Ejemplo n.º 4
0
BOOL CSSD::LoadFromReg(CString RegPath)
{
	CRegistry Reg;
	
	if (RegPath.IsEmpty())
		RegPath = GetRegPath();

	if (!Reg.Open(HKEY_LOCAL_MACHINE, RegPath))
		return FALSE;
	
	if (!Reg.ReadString(_T("Name"), m_ssd.m_szName) ||
		!Reg.ReadString(_T("Email"), m_ssd.m_szEmail) ||
		!Reg.ReadString(_T("SSD"), m_ssd.m_szSerial) )
		return FALSE;

	Reg.Close();
	
	return TRUE;
}
Ejemplo n.º 5
0
BOOL CHostBaseDownloadDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	CComboBox* baudrateCombo = (CComboBox*)GetDlgItem(IDC_BAUDRATE_IDX);
	CComboBox* bufferCombo = (CComboBox*)GetDlgItem(IDC_BUFFER_IDX);

	if(_V8_SUPPORT)
	{
		baudrateCombo->ResetContent();
		for(int i=0; i<9; ++i)
		{
			CString strIdx;
			strIdx.Format("%d", CSerial::BaudrateTable[i]);
			baudrateCombo->AddString(strIdx);
		}
	}
	baudrateCombo->AddString("SPI");

	CRegistry reg;
	reg.SetRootKey(HKEY_CURRENT_USER);
	if(reg.SetKey("Software\\GNSSViewer\\GPS", true))
	{
		m_nBaudrateIdx = reg.ReadInt("hb_baudrate", g_setting.boostBaudIndex);
		m_strPath = reg.ReadString("hb_firmware", "");
		m_nBufferIdx = reg.ReadInt("hb_buffer", 0);
	}
	else
	{
		m_nBaudrateIdx = BAUDRATE_DEFAULT;
	}

	if(m_strPath.IsEmpty())
	{
		m_strPath = theApp.GetCurrrentDir();
		m_strPath += "\\host.bin";
	}

	baudrateCombo->SetCurSel(m_nBaudrateIdx);
	GetDlgItem(IDC_IMG_PATH)->SetWindowText(m_strPath);
	bufferCombo->SetCurSel(m_nBufferIdx);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX 屬性頁應傳回 FALSE
}
Ejemplo n.º 6
0
// CParallelDownloadDlg 
BOOL CParallelDownloadDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	//CComboBox* baudrateCombo = (CComboBox*)GetDlgItem(IDC_BAUDRATE_IDX);
	CComboBox* flashTypeCombo = (CComboBox*)GetDlgItem(IDC_FLASH_TYPE);
	CComboBox* bufferCombo = (CComboBox*)GetDlgItem(IDC_BUFFER_IDX);

	CRegistry reg;
	reg.SetRootKey(HKEY_CURRENT_USER);
	if(reg.SetKey(VIEWER_REG_PATH, true))
	{
		//m_nBaudrateIdx = reg.ReadInt("pl_baudrate", setting->boostBaudIndex);
		//m_nBaudrateIdx = setting->boostBaudIndex;
		m_nFlashType = reg.ReadInt("pl_flashtype", 0);
		m_strPath = reg.ReadString("pl_firmware", "");
		//m_nBufferIdx = reg.ReadInt("pl_buffer", 0);
	}
	else
	{
		m_nBaudrateIdx = g_setting.boostBaudIndex;
		m_nFlashType = 0;
	}

	if(m_strPath.IsEmpty())
	{
		m_strPath = theApp.GetCurrrentDir();
		m_strPath += "\\prom.bin";
	}

	//baudrateCombo->SetCurSel(m_nBaudrateIdx);
	flashTypeCombo->SetCurSel(m_nFlashType);
	
	GetDlgItem(IDC_IMG_PATH)->SetWindowText(m_strPath);
	//((CButton*)GetDlgItem(IDC_IN_LOADER))->SetCheck(m_isInternal);
	//bufferCombo->SetCurSel(m_nBufferIdx);

	return TRUE;  // return TRUE unless you set the focus to a control
}
Ejemplo n.º 7
0
/*
	Determine where data folder is situated
	and store it's path into DataFolder member
*/
void CSettings::FindDataFolder()
{
	AppParams* params = AppParams::instance();
	if (IsDirectory(WinUtils::GetAppFolder() + _T("Data"))) {
		DataFolder     = WinUtils::GetAppFolder() + _T("Data\\");
		SettingsFolder = IuCoreUtils::WstringToUtf8(static_cast<LPCTSTR>(DataFolder));
		
		params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
		params->setSettingsDirectory(IuStringUtils::Replace(SettingsFolder, "\\", "/"));
		IsPortable = true;
		return;
	}

	SettingsFolder =  IuCoreUtils::WstringToUtf8(static_cast<LPCTSTR>(GetApplicationDataPath() + _T("Image Uploader\\")));
	
	params->setSettingsDirectory(IuStringUtils::Replace(SettingsFolder, "\\", "/"));
	#if !defined(IU_SERVERLISTTOOL) && !defined  (IU_CLI) && !defined(IU_SHELLEXT)
	{
		CRegistry Reg;
		CString lang;

		Reg.SetRootKey(HKEY_CURRENT_USER);
		if (Reg.SetKey("Software\\Zenden.ws\\Image Uploader", false))
		{
			CString dir = Reg.ReadString("DataPath");

			if (!dir.IsEmpty() && IsDirectory(dir))
			{
				DataFolder = dir;
				params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
				return;
			}
		}
	}
	{
		CRegistry Reg;
		Reg.SetRootKey(HKEY_LOCAL_MACHINE);
		if (Reg.SetKey("Software\\Zenden.ws\\Image Uploader", false))
		{
			CString dir = Reg.ReadString("DataPath");

			if (!dir.IsEmpty() && IsDirectory(dir))
			{
				DataFolder = dir;
				params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
				return;
			}
		}
	}

	if (FileExists(GetCommonApplicationDataPath() + SETTINGS_FILE_NAME)) {
		DataFolder = GetCommonApplicationDataPath() + _T("Image Uploader\\");
		params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
	}
	else 
		#endif
	
	{
		DataFolder = GetApplicationDataPath() + _T("Image Uploader\\");
		params->setDataDirectory(IuStringUtils::Replace(IuCoreUtils::WstringToUtf8((LPCTSTR)DataFolder), "\\", "/"));
	}
}
Ejemplo n.º 8
0
void CCCFixDlg::OnOK() 
{
	// Open registry
	CRegistry oReg;
	
	// Fix the .cc assocation key
	oReg.OpenKey(CLASSES_ROOT, ".cc", false);
	oReg.WriteString("", "cppfile");
	oReg.CloseKey();

	// Fix the .hh assocation key
	oReg.OpenKey(CLASSES_ROOT, ".hh", false);
	oReg.WriteString("", "hppfile");
	oReg.CloseKey();

	// Find and open the devstudio root key
	char strVCPPRoot[256] = "";
	const char* strVCPPRoots[] = {
		"Software\\Microsoft\\Developer",
		"Software\\Microsoft\\DevStudio\\5.0",
		"Software\\Microsoft\\DevStudio\\6.0",
	};
	for (int k=0; k<3; k++) {
		if (oReg.OpenKey(CURRENT_USER, strVCPPRoots[k], true)) {

			// Loop through possible compilers
			const int iNumCompilers = 6;
			const char* strCompilerKeys[iNumCompilers] = {
				"\\Build System\\Components\\Platforms\\Win32 (ALPHA)\\Tools\\C/C++ Compiler for Alpha",
				"\\Build System\\Components\\Platforms\\Win32 (PowerPC)\\Tools\\C/C++ Compiler for PowerPC",
				"\\Build System\\Components\\Platforms\\Win32 (x86)\\Tools\\32-bit C/C++ Compiler for 80x86",
				"\\Build System\\Components\\Platforms\\Win32 (WCE x86em)\\Tools\\C++ Compiler for 80x86em (Emulation)",
				"\\Build System\\Components\\Platforms\\Win32 (WCE MIPS)\\Tools\\C/C++ Compiler Mips R4100",
				"\\Build System\\Components\\Platforms\\Win32 (WCE SH)\\Tools\\C/C++ Compiler for SH",
			};
			for (int i=0; i<iNumCompilers; i++) {
				char strKey[256] = "";
				strcpy(strKey,strVCPPRoots[k]);
				strcat(strKey,strCompilerKeys[i]);
				// Try to open each key
				if (oReg.OpenKey(CURRENT_USER, strKey, true)) {
					char strInputSpec[256] = "";
					// See if .cc is already in the Input_Spec
					oReg.ReadString("Input_Spec","",strInputSpec);
					oReg.CloseKey();
					if (strlen(strInputSpec)>0 && strstr(strInputSpec,"*.cc")==NULL) {
						// If not, put it on the end
						oReg.OpenKey(CURRENT_USER, strKey, false);
						strcat(strInputSpec,";*.cc");
						oReg.WriteString("Input_Spec",strInputSpec);
						oReg.CloseKey();
					}
				}
			}

			//Fix IDE highlighting
			char strTextEditorKey[256] = "";
			strcpy(strTextEditorKey,strVCPPRoots[k]);
			strcat(strTextEditorKey,"\\Text Editor\\Tabs/Language Settings\\C/C++");
			if (oReg.OpenKey(CURRENT_USER,strTextEditorKey,true)) {
				char strFileExtensions[256] = "";
				oReg.ReadString("FileExtensions","",strFileExtensions);
				oReg.CloseKey();
				if (strlen(strFileExtensions)>0 && strstr(strFileExtensions,"cc")==NULL ) {
					strcat(strFileExtensions,";cc");
				}
				if (strlen(strFileExtensions)>0 && strstr(strFileExtensions,"hh")==NULL ) {
					strcat(strFileExtensions,";hh");
				}
				oReg.OpenKey(CURRENT_USER,strTextEditorKey,false);
				oReg.WriteString("FileExtensions",strFileExtensions);
				oReg.CloseKey();
			}
			
			oReg.CloseKey();
		}
	} 



	CDoneDialog donedlg;
	donedlg.DoModal();
		
	CDialog::OnOK();
}