Private Type test
signature As Long
buf As String
signature2 As Long
v As Variant
End Type
Dim seralized() As Byte
Private Sub Command1_Click()
Dim f As Long
Dim udtTest As test
With udtTest
.signature = &H11223344
.buf = "test string"
.signature2 = &H99887766
.v = Array(1, "blah!", 3.14)
End With
f = mSer.StartSeralize()
Put f, , udtTest
seralized() = mSer.EndSeralize()
Text1 = HexDump(StrConv(seralized, vbUnicode, LANG_US))
End Sub
Private Sub Command2_Click()
Dim f As Long
Dim udtTest As test
f = mSer.StartSeralize()
mSer.SetReadBuffer seralized()
Get f, , udtTest
mSer.EndSeralize
On Error Resume Next
Dim tmp() As String
push tmp, "Signature: " & Hex(udtTest.signature)
push tmp, "Buf: " & udtTest.buf
push tmp, "Signature2: " & Hex(udtTest.signature2)
push tmp, "v: " & Join(udtTest.v, ", ")
Text1 = Join(tmp, vbCrLf)
End Sub