🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: LPITEMIDLIST *ppidl problem

#1817
From: Mark Jacobs
Date: Mon, 11 Jun 2007 09:30
38 lines
1985 bytes
"patrickartaud" <patrickartaud@aidedecision.com> wrote in message 
news:4666815d@newsgroups.borland.com...
> Hello I have done what was advised to me I have include the <shobj.h> but My 
> BCB6 put an error in this file.
> I don't know how to use SHGetSpecialFolderLocation(..) I try but I'don't 
> arrive.
> If you have an example for me this will be fine.

An example to get the system directory (works in BCB5) :-
#define NO_WIN32_LEAN_AND_MEAN

#include <shlobj.h>

#include <vcl.h>

#pragma hdrstop

//.... more headers and stuff ... and then ...

char bfr[300]; LPITEMIDLIST mjites; AnsiString sydir;

if (SHGetSpecialFolderLocation(Handle,CSIDL_SYSTEM,&mjites)==NOERROR)

{

  if (SHGetPathFromIDList(mjites,bfr))

    sydir=IncludeTrailingBackslash(AnsiString(bfr).LowerCase());

  CoTaskMemFree(mjites);

}


-- 
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
Technical Details
Message-ID: <466d1626$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4666815d@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fe92dbb5f150ac79
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mark Jacobs" <http://www.jacobsm.com/mjmsg.htm?BorlandNG>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4666815d@newsgroups.borland.com>
Subject: Re: LPITEMIDLIST *ppidl problem
Date: Mon, 11 Jun 2007 10:30:14 +0100
Lines: 40
Organization: DK Computing
MIME-Version: 1.0
Content-Type: text/plain;
 format=flowed;
 charset="iso-8859-1";
 reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 81.144.157.8
Message-ID: <466d1626$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1181554214 81.144.157.8 (11 Jun 2007 02:30:14 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail