Click to See Complete Forum and Search --> : Binary Registry


programming fool
August 2nd, 2001, 08:51 AM
How do I store a binary value that I can store in the registry using a REG_BINARY value.
I tried using a variable of type Byte, but I tried adding a value to it and slapping it into the registry but it didn't like it. Can you give me an example of doing this?

Ghost308
August 2nd, 2001, 10:20 AM
To write binary data to the registry, try using the Wscript.Shell object for registry access.


'declare this in a module or somethin
Const REG_BINARY = 3

'here is the code to create the Shell object
Dim shell
set shell = CreateObject("wscript.shell") 'oh the magic of Windows Script objects

'this is the method to write to the registry
'the '3' in the code is the binary data i'm sending to the key
'and the REG_BINARY flag is what denotes the use
'of binary storage
shell.RegWrite "HKEY_CURRENT_USER\Software\MyTestKey\", 3, "REG_BINARY"




Hope that makes sense!

cksiow
August 2nd, 2001, 07:56 PM
you can try to look at the code for the activeX DLL in http://vblib.virtualave.net, if you pass it byte array, it will be REG_BINARY.



HTH

cksiow
http://vblib.virtualave.net - share our codes