WriteBinaryValue

This function writes a binary buffer value in the opened registry key.

WriteBinaryValue (ValueName As String, vArray As Variant, BufferSize As Long) As Long

Parameters

ValueName

[in] Name of the value to read.

vArray

[out] Array of bytes to received the binary buffer

BufferSize

[in] The size of the array to write.

Return Value

0: success
1: value name not accessible
 

Sample:

Dim lRet As Long ' return value
aaxRegistry1.SetRootKey "HKEY_LOCAL_MACHINE"
aaxRegistry1.CreateKey "Software\aaxComponents\aaxRegistry\BinarySample"

' Create the buffer to write to the registry, with some data
Dim WriteBuffer As Variant ' Important to do a Dim and
ReDim WriteBuffer(1 To 9) As Byte ' a ReDim
WriteBuffer(1) = 9
WriteBuffer(2) = 8
WriteBuffer(3) = 7
WriteBuffer(4) = 6
WriteBuffer(5) = 5
WriteBuffer(6) = 4
WriteBuffer(7) = 3
WriteBuffer(8) = 2
WriteBuffer(9) = 1

lRet = aaxRegistry1.WriteBinaryValue("BinaryValue", WriteBuffer, 9)
 

Return to aaxRegistry reference