🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1994

Re: Getting the location of My Documents

#1994
From: JB
Date: Fri, 25 May 2007 17:04
20 lines
1433 bytes
>Then something is wrong, because it shouldn't be returning a NULL
>pidl.  Please show your actual code.

AnsiString Pathname;
LPITEMIDLIST pidlDocFiles; 
char Buf[MAX_PATH];

  if (SHGetFolderLocation(NULL, CSIDL_MYDOCUMENTS, NULL, 0, &pidlDocFiles) != S_FALSE)
  {
      SHGetPathFromIDList(pidlDocFiles, Buf);
      Pathname = AnsiString(Buf);
  }


The above gives null in pidlDocFiles, whilst replacing 
CSIDL_MYDOCUMENTS with CSIDL_PERSONAL gives a valid value 
which is translated by SHGETPathFromIDList to the correct path.

JB
Technical Details
Message-ID: <46571711@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4656efa1$1@newsgroups.borland.com> <46571424@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9503052ea4e0798c
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "JB" <jo4508@yahoo.co.uk>
Sender: "JB" <jo4508@yahoo.co.uk>
Reply-To: "JB" <jo4508@yahoo.co.uk>
Subject: Re: Getting the location of My Documents
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 88.107.39.152     
References: <4656efa1$1@newsgroups.borland.com> <46571424@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <46571711@newsgroups.borland.com>
Date: 25 May 2007 10:04:17 -0700
X-Trace: newsgroups.borland.com 1180112657 207.105.83.66 (25 May 2007 10:04:17 -0700)
Lines: 21
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail