> what is the best way to load a class into a buffer ?
> i.e. I have a Class that I need to add to a buffer to send across a TCP/IP
>connection.
> I have been doing socket.SendBuf(msg,sizeOf(msg)); but this only sends garbage.
> Am I better to load each of the class items into the buffer char by char then send
>the buffer ??
> I also tried MOVE() but it had the same effect.
The class data as is won't work... You should implement a SaveToStream,
LoadFromStream on your class and process the data fields 1 at a time... Remember
that references will not transfer so write an image of memory would stuff all dynamic
arrays and strings as these are just references in your instance memory space.
Add a constructor CreateFromStream which takes a stream and calls loadFromStream
to clean up the creation process if you like.
--
Aaron Scott-Boddendijk
INTAZ Limited
+64 7 838 3371 Voice
+64 7 838 3372 Fax
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"