本文整理汇总了C++中CWinApp::GetProfileIntW方法的典型用法代码示例。如果您正苦于以下问题:C++ CWinApp::GetProfileIntW方法的具体用法?C++ CWinApp::GetProfileIntW怎么用?C++ CWinApp::GetProfileIntW使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWinApp
的用法示例。
在下文中一共展示了CWinApp::GetProfileIntW方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}
}