Class TmdCustomSecureMail (unit mdMailSlot)

Inherits from

TmdCustomMailSlot

......................................................... TmdCustomSecureMail .........................................................

Constructors



Functions

Destructor Destroy;

.

Procedure DoDuplicated;


Procedure DoError(Const Msg : String);

Make sure that we have somewhere to store the data

Procedure DoMessageAvail(Const Msg : String);

For version 1.

Properties

Events

event OnDuplicated : TNotifyEvent


event OnError : TmsMessageAvail

New in version 1.

Variables

FDuplicated : TNotifyEvent;


FError : TmsMessageAvail;


FLastMessage : PChar;



Constructors


Functions


Destructor Destroy;

......................................................... TmdCustomSecureMail ......................................................... (* Ver 1.5 Procedure TmdCustomSecureMail.DoMessageAvail(Const Msg : String); Var L : Integer; S,C, SubStr : String; Begin L := Length(Msg); SubStr := Copy(Msg,1,L-4); S := Copy(Msg,L-3,4); C := IntTohex(CalcCRC16(SubStr,L-4),4); If S <> C Then DoError(Msg) else // OK ! Begin If (FLastMessage <> NIL) AND (StrComp(FLastMessage,PChar(Msg)) = 0) AND (Copy(String(FLastMessage),1,4) = Copy(Msg,1,4)) Then Begin // Inform about this mail is ignores since it is a duplicate DoDuplicated; end else Begin If FLastMessage <> NIL Then StrDispose(FLastMessage); FLastMessage := StrNew(PChar(Msg)); Inherited DoMessageAvail(Copy(Msg,5,L-8)); end; end; end; *) New in version 1.6


Procedure DoDuplicated;


Procedure DoError(Const Msg : String);

Make sure that we have somewhere to store the data


Procedure DoMessageAvail(Const Msg : String);

For version 1.6...secure mail format


Properties


Events


event OnDuplicated : TNotifyEvent


event OnError : TmsMessageAvail

New in version 1.6


Variables


FDuplicated : TNotifyEvent;


FError : TmsMessageAvail;


FLastMessage : PChar;