CString getTempDir()
{
TCHAR tempPath[MAX_PATH + 1] = _T("");
const UINT SIZE_IN_TCHARS = sizeof(tempPath)/sizeof(TCHAR);
DWORD retval = GetTempPath(SIZE_IN_TCHARS, tempPath);
if (SIZE_IN_TCHARS < retval) {
THROW(Exception(_T("Failed getting temp directory path")));
}
return CString(tempPath);
} //end of getTempDir
|