GetTempPath
Hello, Can someone please explain what I'm doing wrong here?
The program crashes, I'm basically trying to get the temporary dir. I spend a while trying to figure it out.
basically I'm just trying to get the temporary path in a string.
1 2
|
LPWSTR tmppath = L""; //I think this is where I'm messing up...
GetTempPath(MAX_PATH, tmppath);
|
1 2 3 4 5 6 7
|
TCHAR lpTempPathBuffer[MAX_PATH];
.
.
.
// Gets the temp path env string (no guarantee it's a valid path).
dwRetVal = GetTempPath(MAX_PATH, // length of the buffer
lpTempPathBuffer); // buffer for path
|
Creating and Using a Temporary File
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363875%28v=vs.85%29.aspx
Topic archived. No new replies allowed.