Board index » cppbuilder » Get location of My Documents

Get location of My Documents


2006-12-20 06:10:37 AM
cppbuilder52
Whats the accepted way to get the location of the current user's My
Documents folder? I'm trying to use:
#include <shlobj.h>
LPITEMIDLIST pidl;
if( SHGetSpecialFolderLocation(Handle,CSIDL_PERSONAL,&pidl) == NOERROR)
{
char buf[MAX_PATH];
SHGetPathFromIDList(pidl,buf);
String sFolderString = buf;
}
but I'm getting compiler errors from shobjidl.h for duplicate symbols
under BCB6. Should I be using a different header?
 
 

Re:Get location of My Documents

"Randy" < XXXX@XXXXX.COM >wrote in message
Quote
I'm getting compiler errors from shobjidl.h for duplicate symbols
under BCB6. Should I be using a different header?
No. You need to add NO_WIN32_LEAN_AND_MEAN to the Conditionals list in the
Project Options.
Gambit
 

Re:Get location of My Documents

Remy Lebeau (TeamB) wrote:
Quote
>I'm getting compiler errors from shobjidl.h for duplicate symbols
>under BCB6. Should I be using a different header?

No. You need to add NO_WIN32_LEAN_AND_MEAN to the Conditionals list in the
Project Options.
Excellent....thanks!
That one's not in the help file that I can find. What else will it
effect?
 

{smallsort}

Re:Get location of My Documents

< XXXX@XXXXX.COM >wrote in message
Quote
That one's not in the help file that I can find.
You won't find it documented anywhere.
Quote
What else will it effect?
Whether WIN32_LEAN_AND_MEAN is defined or not controls which API headers are
included into the project by default.
Whether NO_WIN32_LEAN_AND_MEAN is defined or not controls whether
WIN32_LEAN_AND_MEAN is defined.
If you want more details about what is actually happening, look for those
defines in the VCL header files.
Gambit