当前位置: 首页>>代码示例>>C++>>正文


C++ CWinApp::WriteProfileBinary方法代码示例

本文整理汇总了C++中CWinApp::WriteProfileBinary方法的典型用法代码示例。如果您正苦于以下问题:C++ CWinApp::WriteProfileBinary方法的具体用法?C++ CWinApp::WriteProfileBinary怎么用?C++ CWinApp::WriteProfileBinary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CWinApp的用法示例。


在下文中一共展示了CWinApp::WriteProfileBinary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: WriteRegCharFormat

bool CEsmScriptOptions::WriteRegCharFormat (void) {
  CWinApp*	pApp = AfxGetApp();
  CString	RegName;
  BOOL		Result = TRUE;
  int		Index;

	/* Output all the script formats */
  for (Index = 0; Index < ESMSCRIPT_NUMFORMATS; Index++) {
    RegName.Format(_T("%s%d"), ESMSCR_REGENTRY_CHARFORMAT, Index);
    Result &= pApp->WriteProfileBinary(ESMSCR_REGSEC_SCRIPT, RegName, (BYTE *) &m_Formats[Index], sizeof(m_Formats[Index]));
   }

  return (Result != 0);
 }
开发者ID:Purr4me,项目名称:TES5Edit-GoogleCode,代码行数:14,代码来源:EsmScriptOptions.cpp

示例2: TransferSettings

void CUIforETWDlg::TransferSettings(bool saving)
{
	CWinApp* pApp = AfxGetApp();

	NameToBoolSetting bools[] =
	{
		{ L"CompressTraces", &bCompress_ },
		{ L"CswitchStacks", &bCswitchStacks_ },
		{ L"SampledStacks", &bSampledStacks_ },
		{ L"FastSampling", &bFastSampling_ },
		{ L"GPUTracing", &bGPUTracing_ },
		{ L"CLRTracing", &bCLRTracing_ },
		{ L"ShowCommands", &bShowCommands_ },
		{ L"UseOtherKernelLogger", &bUseOtherKernelLogger_ },
		{ L"BackgroundMonitoring", &bBackgroundMonitoring_ },
		{ L"ChromeDeveloper", &bChromeDeveloper_ },
		{ L"IdentifyChromeProcessesCPU", &bIdentifyChromeProcessesCPU_ },
		{ L"AutoViewTraces", &bAutoViewTraces_ },
		{ L"RecordPreTrace", &bRecordPreTrace_ },
		{ L"HeapStacks", &bHeapStacks_ },
		{ L"VirtualAllocStacks", &bVirtualAllocStacks_ },
		{ L"VersionChecks", &bVersionChecks_ },
	};

	for (auto& m : bools)
	{
		if (saving)
			pApp->WriteProfileInt(pSettings, m.pName, *m.pSetting);
		else
			*m.pSetting = pApp->GetProfileIntW(pSettings, m.pName, *m.pSetting) != false;
	}

	NameToRangedInt ints[] =
	{
		// Note that a setting of kKeyLoggerFull cannot be restored from
		// settings, to avoid privacy problems.
		{ L"InputTracing", (int*)&InputTracing_, kKeyLoggerOff, kKeyLoggerAnonymized },
		{ L"TracingMode", (int*)&tracingMode_, kTracingToMemory, kHeapTracingToFile },
        { L"GpuMode", (int*)&gpuMode_, kGPUDefault, kGPUVerbose },
	};

	for (auto& m : ints)
	{
		if (saving)
			pApp->WriteProfileInt(pSettings, m.pName, *m.pSetting);
		else
		{
			int temp = pApp->GetProfileIntW(pSettings, m.pName, *m.pSetting);
			if (temp < m.min)
				temp = m.min;
			if (temp > m.max)
				temp = m.max;
			*m.pSetting = temp;
		}
	}

	NameToUInt64 bigInts[] =
	{
		{ L"ChromeKeywords", &chromeKeywords_ },
	};

	for (auto& m : bigInts)
	{
		if (saving)
		{
			pApp->WriteProfileBinary(pSettings, m.pName, (LPBYTE)m.pSetting, sizeof(*m.pSetting));
		}
		else
		{
			LPBYTE temp = 0;
			UINT byteCount = sizeof(temp);
			pApp->GetProfileBinary(pSettings, m.pName, &temp, &byteCount);
			if (byteCount == sizeof(temp))
				*m.pSetting = *(uint64_t*)temp;
			delete [] temp;
		}
	}

	NameToString strings[] =
	{
		{ L"HeapProfiledProcess", &heapTracingExes_ },
		{ L"WSMonitoredProcesses", &WSMonitoredProcesses_ },
		{ L"ExtraKernelFlags", &extraKernelFlags_ },
		{ L"ExtraStackWalks", &extraKernelStacks_ },
		{ L"ExtraUserProviders", &extraUserProviders_ },
		{ L"PerfCounters", &perfCounters_ },
	};

	for (auto& m : strings)
	{
		if (saving)
			pApp->WriteProfileStringW(pSettings, m.pName, m.pSetting->c_str());
		else
		{
			CString result = pApp->GetProfileStringW(pSettings, m.pName, m.pSetting->c_str());
			*m.pSetting = result;
		}
	}
}
开发者ID:MikeMarcin,项目名称:UIforETW,代码行数:99,代码来源:Support.cpp


注:本文中的CWinApp::WriteProfileBinary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。