-1
我的代码:WINAPI unicode的问题
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是PROCESSS ID。但它会返回奇怪的东西。就像unicode符号,然后是路径的一部分。我做错了什么?
对我感到羞耻。抱歉。 :) – blez