本文整理汇总了C++中CElapsedTime::SetMaxIncrement方法的典型用法代码示例。如果您正苦于以下问题:C++ CElapsedTime::SetMaxIncrement方法的具体用法?C++ CElapsedTime::SetMaxIncrement怎么用?C++ CElapsedTime::SetMaxIncrement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CElapsedTime
的用法示例。
在下文中一共展示了CElapsedTime::SetMaxIncrement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HelperGetToucanDLL
static HMODULE HelperGetToucanDLL()
{
if (g_toucan_dll)
return g_toucan_dll;
// Only scan once every five seconds
if ( g_NextToucanDLLSearchTime.Get () < 5000 )
return NULL;
g_NextToucanDLLSearchTime.SetMaxIncrement ( 500, true );
g_NextToucanDLLSearchTime.Reset ();
/*
** We need to enumerate the DLLs loaded to find toucan dll.
** This is done because the toucan dll changes with each update.
** The toucan dll has the following format. "xfire_toucan_{BUILD_NUMBER}.dll"
** We simply try to find a dll w/ the prefix "xfire_toucan"
*/
HANDLE snapshot_handle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
if (snapshot_handle != INVALID_HANDLE_VALUE)
{
MODULEENTRY32 module_entry;
module_entry.dwSize = sizeof(MODULEENTRY32);
BOOL result = Module32First(snapshot_handle, &module_entry);
char module_name[] = "xfire_toucan";
DWORD module_name_len = sizeof(module_name)-1;
while (result)
{
if (CompareStringA(LOCALE_USER_DEFAULT, NORM_IGNORECASE, module_entry.szModule, module_name_len, module_name, module_name_len) == CSTR_EQUAL)
{
g_toucan_dll = module_entry.hModule;
break;
}
result = Module32Next(snapshot_handle, &module_entry);
}
CloseHandle(snapshot_handle);
}
return g_toucan_dll;
}