|
-
Apr 1st, 2001, 04:59 AM
#1
Thread Starter
Frenzied Member
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);
-
Apr 1st, 2001, 06:17 AM
#2
Monday Morning Lunatic
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).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Apr 1st, 2001, 07:40 AM
#3
Thread Starter
Frenzied Member
Thank you! That helped!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|