|
-
May 6th, 2000, 07:58 PM
#1
Thread Starter
Junior Member
I think this question has been posted before, but I don't remember this anymore. So what should I do to make the program write all the entries in one registry key to a listbox/combobox?
-
May 6th, 2000, 08:41 PM
#2
Addicted Member
There was alot of stuff about the Registry posted in the thread here. The answer to your question, listing all the Entries, is in the post by me (SonGouki). The code I posted there allows you to do multiple things including any combination of listing all of the Entries in a Key and listing all Sub-Keys of a Key (can go also go through all Sub-Keys of a Sub-Key, using recursion).
If you need me to explain it at all just ask.
Dan PM
Analyst Programmer
VB6 SP3 (also VB4 16-bit sometimes  )
-
May 6th, 2000, 08:59 PM
#3
Addicted Member
I tried to enumerate the COMPLETE registry but all I got was a stack overflow
Razzle
ICQ#: 31429438
What is the difference between a raven?
-The legs. The length is equal, especially the right one. 
-
May 6th, 2000, 09:48 PM
#4
Addicted Member
Well, naturally, you can't enumerate the entire registry in a single ListBox, it can only hold 32767 entries. With my code you can only enumerate, at most, one top-level Key at a time, so instead place the results into a FlexGrid or several ListBoxes (or even just into an array).
Dan PM
Analyst Programmer
VB6 SP3 (also VB4 16-bit sometimes  )
-
May 6th, 2000, 10:08 PM
#5
Addicted Member
I didn't use a listbox but an array
I ran a recursive function... this caused the stack overflow
Razzle
ICQ#: 31429438
What is the difference between a raven?
-The legs. The length is equal, especially the right one. 
-
May 7th, 2000, 02:04 AM
#6
Addicted Member
Hmmmmm...
It sounds like a problem with your code. An array can hold
up to 2,147,483,647 elements, so I don't think you should
have any problems there. Post your code so I can take a
look at it and see if I can spot your problem.
Dan PM
Analyst Programmer
VB6 SP3 (also VB4 16-bit sometimes  )
-
May 8th, 2000, 12:06 AM
#7
Addicted Member
The array isn't the problem. It's the function calls that cause the stack overflow
Code:
Public Sub RegistrySearch(hkey As Long, Path As String)
Dim allkeys As Variant
Dim i&, x&
Dim allvalues As Variant
DoEvents
If Right(Path, 1) = "\" Then Path = Left(Path, Len(Path) - 1)
allkeys = GetAllKeys(hkey, Path)
If IsArray(allkeys) = True Then
For i = LBound(allkeys) To UBound(allkeys)
RegKeys(UBound(RegKeys)).Path = Path & "\" & allkeys(i)
ReDim RegKeys(UBound(RegKeys)).Values(0)
allvalues = GetAllValues(hkey, Path & "\" & allkeys(i))
For x = LBound(allvalues) To UBound(allvalues)
RegKeys(UBound(RegKeys)).Values(UBound(RegKeys(UBound(RegKeys)).Values)).Name = allvalues(x, 0)
RegKeys(UBound(RegKeys)).Values(UBound(RegKeys(UBound(RegKeys)).Values)).Setting = allvalues(x, 1)
ReDim Preserve RegKeys(UBound(RegKeys)).Values(UBound(RegKeys(UBound(RegKeys)).Values) + 1)
Next x
' Form1.Caption = Path & allkeys(i)
ReDim Preserve RegKeys(UBound(RegKeys) + 1)
RegistrySearch hkey, Path & "\" & allkeys(i)
DoEvents
Next i
End If
End Sub
Razzle
ICQ#: 31429438
What is the difference between a raven?
-The legs. The length is equal, especially the right one. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|