Article View: borland.public.cppbuilder.nativeapi
Article #5544Re: AccessVialoation on SHGetSpecialFolderLocation
From: Remy Lebeau (TeamB)
Date: Fri, 05 Aug 2005 23:54
Date: Fri, 05 Aug 2005 23:54
21 lines
1512 bytes
1512 bytes
"George Francis" <george_f@hotmail.com> wrote in message
news:42f3d881$1@newsgroups.borland.com...
> SHGetSpecialFolderLocation(0, CSIDL_SENDTO, &pidl);
> SHGetPathFromIDList(pidl, cBuf);
You should be checking the return value of SHGetSpecialFolderLocation()
before calling SHGetPathFromIDList():
LPITEMIDLIST pidl = NULL;
if( SUCCEEDED(SHGetSpecialFolderLocation(0, CSIDL_SENDTO, &pidl)) )
{
char cBuf[MAX_PATH+1] = {0};
SHGetPathFromIDList(pidl, cBuf);
//...
CoTaskMemFree(pidl);
}
Gambit
Technical Details
Message-ID:
<42f3fc9a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42f3d881$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7f4466ab7adf1876 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <42f3d881$1@newsgroups.borland.com> Subject: Re: AccessVialoation on SHGetSpecialFolderLocation Date: Fri, 5 Aug 2005 16:54:55 -0700 Lines: 23 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <42f3fc9a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1123286170 68.69.17.41 (5 Aug 2005 16:56:10 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail