【发布时间】:2011-11-09 19:43:16
【问题描述】:
我有代码:
wchar_t* temp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 1000 * sizeof(wchar_t));
wchar_t* temp2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 1000 * sizeof(wchar_t));
GetTempPathW(1000, temp);
GetTempFileNameW(temp, L"vdr", GetCurrentProcessId(), temp2);
HeapFree(GetProcessHeap(), 0, temp2);
MessageBoxW(0,temp2,0,0);
它应该创建一个文件“vdrXXXX.tmp”,其中 XXXX 作为进程 ID。但它返回奇怪的东西。像 unicode 符号,然后是路径的一部分。我做错了什么?
【问题讨论】: