Getting data from RegEnumValue

In Visual C++ v5 I am looping through registry entries picking up the subgroups using RegEnumKey and I now wish to extract the data from an entry in the subgroup eg Title in HKEY_LOCAL_MACHINE\software\microsoft\browser\CurrentVersion\Title.
My RegEnumValue reads a couple of entries then gives RC 234 (ERROR_MORE_DATA I think) My result string is 1000 bytes.
What am I doing wrong? I am so close but can't figure it out.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Use RegQuerryValueEx() instead.  If you specify too short of a buffer to this procedure, it will return 234 also, but it will store the length needed for the buffer in the first 4 bytes of the buffer you specify.  So you can use this length to allocate a new buffer that is long enough.

Let me know if you have any questions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cjbezantAuthor Commented:
Many thanks nietod, this indeed has solved my problem.

There are a acouple of other things I need to crack. I need to put a bitmap as the background to my dialog boxes and I need to increase the text size of my static text that form the heading for a listbox. In VB this was easy-peasy but in VC++ I can't find how to do it.

Do you have any book recommendations to help me learn VC++ MFC and would include these topics?

Thanks again for your help. The registry was a major stumbling block for me. None of the online help explains it.
These really should be asked as seperate questions, but briefly,

>>bitmap as the background to my dialog boxes
Draw the bitmap with BitBlt(0 (or one of its related procedures) during the dialog's WM_PAINT message.

>> increase the text size of my static text
Send the control a WM_SETFONT message.

>> book recommendations to help me learn VC++ MFC
I recommend you learn the basics of windows programming BEFORE learning MFC.  MFC makes it easier by hiding lots of details, but that is not necessarly the best way to start out, first you should learn about those details, then you will be better prepared to handle probkems.  I would start with the charles Petzold book "Programming Windows" (I believe its called).  Then try one of the many MFC books.
cjbezantAuthor Commented:

I wasn't trying to short circuit the system, just a drowniong man clasping at a straw!

Thanks again.
Just ask another qeustion or two to keep the DB well organized.  (all questions are saved for posterify).  If you run low on points, as a low point value question and let the experts know you are running low, they will usually still answer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.