Article View: borland.public.cppbuilder.nativeapi
Article #14763Re: Localized name for My Documents
From: Bob Gonder
Date: Fri, 01 Aug 2003 21:00
Date: Fri, 01 Aug 2003 21:00
36 lines
2173 bytes
2173 bytes
Bob Gonder wrote:
>This bit from the PrintStrRet() sample code:
>
> case STRRET_WSTR:
> cch = WideCharToMultiByte(CP_OEMCP, WC_DEFAULTCHAR,
> lpStr->DUMMYUNIONNAME.pOleStr, -1,NULL, 0,NULL,NULL);
More specificly, replacing all the WideCharxxx and printf stuf with
this:
case STRRET_WSTR:
MessageBoxW( hWnd, lpStr->DUMMYUNIONNAME.pOleStr,
"W\0S\0T\0R\0\0", MB_OK|MB_TOPMOST );
displays My Documents.
>if( NOERROR == SHGetSpecialFolderLocation( hWnd,CSIDL_PERSONAL,&pidl))
>{
> if( !SHGetPathFromIDList( pidl, filepath ) )
> { lstrcpy( filepath, "c:\\My Documents");
> };
> if( SUCCEEDED(SHGetDesktopFolder(&pFolder)) )
> {
> if(
> SUCCEEDED(pFolder->lpVtbl->GetDisplayNameOf(
> pFolder, pidl, SHGDN_INFOLDER,
> &sName)) )
>
> PrintStrRet(pidl, &sName);
>
> if (pFolder != NULL)
> pFolder->lpVtbl->Release(pFolder);
> };
> pShellMalloc->lpVtbl->Free(pShellMalloc,pidl);
>};
Technical Details
Message-ID:
<81lliv4nav7ohaqfhbfs77nuaept6mq0l2@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!209.98.3.206.MISMATCH!hermes.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f291bf5@newsgroups.borland.com> <3f2a9ab0@newsgroups.borland.com> <0vcliv8blik8ppbn2vr5rq7v3rvpq5elge@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,a8f8c57e6feba365 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-01 14:07:54 PST From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Localized name for My Documents Date: Fri, 01 Aug 2003 14:00:39 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <81lliv4nav7ohaqfhbfs77nuaept6mq0l2@4ax.com> References: <3f291bf5@newsgroups.borland.com> <3f2a9ab0@newsgroups.borland.com> <0vcliv8blik8ppbn2vr5rq7v3rvpq5elge@4ax.com> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.31.164.39 X-Trace: newsgroups.borland.com 1059771637 67.31.164.39 (1 Aug 2003 14:00:37 -0700) Lines: 38 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!209.98.3.206.MISMATCH!hermes.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail