VB6 has a nice feature, when it comes to UDTs.
It has builtin serializing/deserializing routines, which are capable to write
an even complex and deeply nested UDT to a File per VBs Put-statement
(no matter whether this UDT contains dynamic members like Arrays or Strings) -
and later on it can read this UDT back from the File it was saved to (per Get).
Too bad, that this feature is restricted to the FileSystem (VBs Open, Put and Get calls) -
and not exposed in a way, to make it usable InMemory (writing and reading to ByteArrays).
The little Demo here does just that, with a little workaround (using Named-Pipes),
which VBs Open-Statement is able to understand and deal with.
The main-functionality sits in a little Class, named: cPipedUDTs ...
which throws an Event which allows you, to write your UDT for serialization
into the Pipe - and another Event for the opposite direction (the deserialization).
Not much code - and easy to understand I think (Demo contains comments as well):
UDTsPipeSerializing.zip
Have fun!
Olaf
It has builtin serializing/deserializing routines, which are capable to write
an even complex and deeply nested UDT to a File per VBs Put-statement
(no matter whether this UDT contains dynamic members like Arrays or Strings) -
and later on it can read this UDT back from the File it was saved to (per Get).
Too bad, that this feature is restricted to the FileSystem (VBs Open, Put and Get calls) -
and not exposed in a way, to make it usable InMemory (writing and reading to ByteArrays).
The little Demo here does just that, with a little workaround (using Named-Pipes),
which VBs Open-Statement is able to understand and deal with.
The main-functionality sits in a little Class, named: cPipedUDTs ...
which throws an Event which allows you, to write your UDT for serialization
into the Pipe - and another Event for the opposite direction (the deserialization).
Not much code - and easy to understand I think (Demo contains comments as well):
UDTsPipeSerializing.zip
Have fun!
Olaf