tags:

views:

1009

answers:

3

I'm looking for a good example of reading and writing to the Windows Registry using VB6.

Yes, I know there are lots of mediocre examples. I spent an hour googling and testing. Some were incredibly complex, others had only some of the functions, and almost none of it had been vetted in any way (voted on).

Since Stack Overflow is intended to the canonical location for answers to programming questions, it seems reasonable to post it here.

A: 

Very, very googleable. Nail me if you wish. I still believe questions like this, which take about 2 seconds to find and answer to by doing a simple web search do not belong to SO.

petr k.
In some ways I agree, but SO's stated purpose is to be a single place to find programming related information (whether it will succeed is another matter.,..)
Mitch Wheat
@petr k.: thx for that 'punishment' downvote
Mitch Wheat
@Mitch: yep I see that now. downvoted accidentally, I've corrected that instantly.
petr k.
Anyways, I tend to believe the poster of this question has made NO effort prior to asking. For me, the merit of SO lies somewhere else, that's all..
petr k.
+5  A: 

Karl Peterson's site has great VB6 examples. Registry here.

Mitch Wheat
Wow, that is an amazing resource. Lots of great code samples beyond just the Registry stuff.I haven't tried out his Registry example, but I've voted for this result b/c Karl Peterson (IIRC = guru.
Clay Nichols
Yeah. When I was coding in VB6/VBA I would be a frequent visitor to Karl's previous web site :-)
Mitch Wheat
+1  A: 

There are lots of Registry code samples but of the 10 I looked at 9 were overly complex and in some cases buggy.

I used the sample below but got some weird errors where it wasn't correctly calculating the length of the values retrieved from the registry and stripping off the last character.

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=28518&lngWId=1

Clay Nichols