|
-
October 12th, 2007, 01:13 PM
#1
Problem retrieving ProgramFiles path
Hi everyone,
I am trying to get the programefiles path but without succes. I tried it with:
TCHAR localised_path[MAX_PATH];
SHGetFolderPath(NULL, localised_path, CSIDL_PROGRAM_FILES, 0);
but it said SHGetFolderPath and CSIDL_PROGRAM_FILES are undeclaired identifiers
also I tried it with
TCHAR localised_path[MAX_PATH];
SHGetSpecialFolderPath(NULL, localised_path, CSIDL_PROGRAM_FILES, 0);
-
October 12th, 2007, 01:19 PM
#2
Re: Problem retrieving ProgramFiles path
It looks like you have your paramater list out of order.
Code:
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_PROGRAM_FILES,
NULL,
0,
szPath)))
{
PathAppend(szPath, TEXT("New Doc.txt"));
HANDLE hFile = CreateFile(szPath, ...);
}
"Live only for tomorrow, and you will have a lot of empty yesterdays today."
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
|