-
I got the following code from parksie, that had a messagebox show the Windows Dir.
But I don't understand what the first line does:
The first line:
Code:
TCHAR pcBuf[MAX_PATH];
The entire code:
Code:
TCHAR pcBuf[MAX_PATH];
GetWindowsDirectory(pcBuf, MAX_PATH);
MessageBox(pcBuf, "Windows folder!", MB_OK);
-
TCHAR is a universal character type -- if you compile for ANSI or MBCS (multi-byte character set) then it resolves to char. If you compile for Unicode it resolves to wchar_t (a 2-byte type).
So, the first line:
Code:
TCHAR pcBuf[MAX_PATH];
This allocates an array of TCHAR with size MAX_PATH (a constant defined in the Windows header files, and I think it's 260).
-
Thank you! That helped! :)