|
-
Jul 20th, 2001, 10:21 PM
#1
Thread Starter
New Member
Setting Reg_Binary
I've been developing a Library that allows the ability to set and read values from the registy. Everything works great except I can't seem to set the correct Registry value for Binary. For Example, if I open regedit, and modify a BINARY key, let's say I put 10. The Read part of my code returns 10. However, when I set the value of 10, my registry shows 0a
I'm using the API that I keep seeing all over the place.
lngResult = RegSetValueEx(HKEY_LOCAL_MACHINE, "Testing", 0, REG_BINARY, bytData(0), UBound(bytData()) + 1)
All I want is to see the same result as if I open up and "modify' a value though RegEdit.
Any ideas?
Once I get that working, I'll post my code up so that maybe someone else can take advantage of it.
-
Jul 24th, 2001, 11:22 AM
#2
PowerPoster
check out the sample at my home page
-
Jul 28th, 2001, 04:20 PM
#3
Monday Morning Lunatic
However, when I set the value of 10, my registry shows 0a
It's displayed in hex...&H0A == 10
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 29th, 2001, 03:42 AM
#4
PowerPoster
Here is some code from the sample code that I've uploaded on my home page 
VB Code:
'// SaveSetting
If RegSetValueEx(HKEY_LOCAL_MACHINE, "Software\temp", 0, REG_BINARY, CInt("10"), 4) = ERROR_SUCCESS Then
MsgBox "Data successful saved"
Else
MsgBox "Fail to save data"
End If
'// GetSetting
If RegQueryValueEx(HKEY_LOCAL_MACHINE, "Software\temp", 0, REG_BINARY, strData, 4) = ERROR_SUCCESS Then
MsgBox "Data is = " & strData
Else
MsgBox "Fail to retrieve data"
End If
regards,
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
|