测试一下,主要测试对贴代码的效果,还有速度等.
TCHAR szTemp[
4096
];
// But before wqe do this, we first check if the ".local" file exists
if (GetModuleFileName(NULL, szTemp, 4096 ) > 0 )
... {
_tcscat_s(szTemp, _T(".local"));
if (GetFileAttributes(szTemp) == INVALID_FILE_ATTRIBUTES)
...{
// ".local" file does not exist, so we can try to load the dbghelp.dll from the "Debugging Tools for Windows"
if (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0)
...{
_tcscat_s(szTemp, _T("/Debugging Tools for Windows/dbghelp.dll"));
// now check if the file exists:
if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES)
...{
m_hDbhHelp = LoadLibrary(szTemp);
}
}
// Still not found? Then try to load the 64-Bit version:
if ( (m_hDbhHelp == NULL) && (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0) )
...{
_tcscat_s(szTemp, _T("/Debugging Tools for Windows 64-Bit/dbghelp.dll"));
if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES)
...{
m_hDbhHelp = LoadLibrary(szTemp);
}
}
}
}
// But before wqe do this, we first check if the ".local" file exists
if (GetModuleFileName(NULL, szTemp, 4096 ) > 0 )
... {
_tcscat_s(szTemp, _T(".local"));
if (GetFileAttributes(szTemp) == INVALID_FILE_ATTRIBUTES)
...{
// ".local" file does not exist, so we can try to load the dbghelp.dll from the "Debugging Tools for Windows"
if (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0)
...{
_tcscat_s(szTemp, _T("/Debugging Tools for Windows/dbghelp.dll"));
// now check if the file exists:
if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES)
...{
m_hDbhHelp = LoadLibrary(szTemp);
}
}
// Still not found? Then try to load the 64-Bit version:
if ( (m_hDbhHelp == NULL) && (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0) )
...{
_tcscat_s(szTemp, _T("/Debugging Tools for Windows 64-Bit/dbghelp.dll"));
if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES)
...{
m_hDbhHelp = LoadLibrary(szTemp);
}
}
}
}
怪了,那么多语言,居然没有c++.用c#凑合一下了.