This function reads a binary buffer value in the opened registry key.
ReadBinaryValue (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, out] In input, holds the maximum size of the vArray buffer. In output, receive the size of the filled vArray buffer.
Return Value
0: success
1: value name not accessible
2: value is not of type binary
3: buffer size too smal to receive full buffer
4: failed to read buffer
Sample:
Dim lRet As Long ' return value
Dim ReadBuffer As Variant
ReDim ReadBuffer(1 To 500) As Byte 'oversized buffer
Dim BufSize As Long
BufSize = 500
aaxRegistry1.SetRootKey "HKEY_LOCAL_MACHINE"
aaxRegistry1.OpenKey "Software\aaxComponents\aaxRegistry\BinarySample"
' In input, BufSize must be to 500 (the buffer size)
lRet = aaxRegistry1.ReadBinaryValue("BinaryValue", ReadBuffer, BufSize)
' In output, BufSize will be the size of data in registry
If (lRet = 0) Then
MsgBox "Read success.", vbInformation, "aaxRegistry"
End If