Jeremy,

Doing msg := MyMessageStruct is just sending the memory address for the data
on your PC to another PC.  It's not going to mean anything when it gets
there.

One field at a time is the only way to do it.  You might also want to
include some extra data when you send so you can be sure that the data you
are getting is from a compatable class.  Might not be an issue for you
though.

If you want to send whole objects around the place use DCOM.

Wes

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of [EMAIL PROTECTED]
> Sent: Monday, 18 December 2000 23:40
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Best way to load a buffer
>
>
> This is is basically.
>
>    TMessageStruct = Class(TObject)
>        DataType    : char;
>        Sender      : String;
>        MessageType : char;
>        BMPIndex    : integer;
>        MessageText : string;
>
> BUT we just realized that this data needs to be encrypted as
> well, so might do the savetostream thing that scott meantions.....
>
> Cheers, Jeremy Coulter
>
>
>
> > Jeremy,
> >
> > In your example, what gets assigned to msg?
> >
> > Wes
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> > > Behalf Of [EMAIL PROTECTED]
> > > Sent: Monday, 18 December 2000 23:04
> > > To: Multiple recipients of list delphi
> > > Subject: [DUG]: Best way to load a buffer
> > >
> > >
> > > Hi all.
> > >
> > > 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.
> > >
> > > Cheers, Jeremy Coulter
> > >
> > >
> > >
> > >
> > > ------------------------------------------------------------------
> > > ---------
> > >     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"
> > >
> >
> ------------------------------------------------------------------
> ---------
> >     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"
>
>
>
>
>
> ------------------------------------------------------------------
> ---------
>     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"
>

---------------------------------------------------------------------------
    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"

Reply via email to