🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: RegQueryValueEx problem

#15594
From: robertbienert gmx.net robertbien...
Date: Sat, 21 Jun 2003 12:51
40 lines
2378 bytes
Remy Lebeau (TeamB) wrote:
> Just pass it as-is to RegQueryValueEx(), ie:
> 
>     int __stdcall getShellFolder(int folder, char *buffer, DWORD buffersize)
>     {
>         //...
>         RegQueryValueEx(regh, regkey, NULL, NULL,
> reinterpret_cast<LPBYTE>(buffer), &buffersize);
>         //...
>     }

I see.

> Or, if you go the SHGetSpecialFolderLocation() approach (which you should do
> anyway):

I found SHGetSpecialFolderPath on MSDN, that seems to be the summary of 
the following.

>     int __stdcall getShellFolder(int folder, char *buffer, DWORD buffersize)
>     {
>         LPITEMIDLIST pidl = NULL;
>         int retval = 0;
> 
>         if( buffersize >= MAX_PATH )
>         {
>             if( SUCCEEDED(SHGetSpecialFolderLocation(NULL, folder, &pidl)) )
>             {
>                 retval = SHGetPathFromIDList(pidl,  buffer);
>                 CoTaskMemFree(pidl);
>             }
>         }
> 
>         return retval;
>     }

Yours,
-- 
Robert Bienert <robertbienert@gmx.net>
Check also my free software at http://www.rbprogs.de.vu/
Technical Details
Message-ID: <3ef454db$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3eef5413@newsgroups.borland.com> <3eef5db8$1@newsgroups.borland.com> <3ef0879a$1@newsgroups.borland.com> <3ef09c68@newsgroups.borland.com> <3ef0da0c@newsgroups.borland.com> <3ef0de90@newsgroups.borland.com> <3ef379f4@newsgroups.borland.com> <3ef3804e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,5800567a1464c960
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-06-21 06:04:01 PST
Date: Sat, 21 Jun 2003 14:51:16 +0200
From: "robertbienert<AT>gmx.net" <"robertbienert<AT>gmx.net">
User-Agent: Mozilla/5.0 (Windows; U; Win98; de-AT; rv:1.2) Gecko/20021126
X-Accept-Language: de, en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: RegQueryValueEx problem
References: <3eef5413@newsgroups.borland.com> <3eef5db8$1@newsgroups.borland.com> <3ef0879a$1@newsgroups.borland.com> <3ef09c68@newsgroups.borland.com> <3ef0da0c@newsgroups.borland.com> <3ef0de90@newsgroups.borland.com> <3ef379f4@newsgroups.borland.com> <3ef3804e$1@newsgroups.borland.com>
In-Reply-To: <3ef3804e$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 195.127.134.243
Message-ID: <3ef454db$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1056199899 195.127.134.243 (21 Jun 2003 05:51:39 -0700)
Lines: 41
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail