anchor.diff:  
        procedure SetLibName(s: string);
   
  -     // eventy z dll do TMTBIFace:
  -     procedure OnLibBeforeOpen(Sender:TObject); stdcall;
  -     procedure OnLibAfterOpen(Sender:TObject); stdcall;
  -     procedure OnLibBeforeClose(Sender:TObject); stdcall;
  -     procedure OnLibAfterClose(Sender:TObject); stdcall;
  -     procedure OnLibBeforeStart(Sender:TObject); stdcall;
  -     procedure OnLibAfterStart(Sender:TObject); stdcall;
  -     procedure OnLibBeforeStop(Sender:TObject); stdcall;
  -     procedure OnLibAfterStop(Sender:TObject); stdcall;
  -     procedure OnLibError(Sender: TObject; errValue: word; errAddr: byte; errMsg:string); stdcall;
  -     procedure OnLibInputChanged(Sender: TObject; board:byte); stdcall;
  -     procedure OnLibOutputChanged(Sender: TObject; board:byte); stdcall;
  -
     protected
       { Protected declarations }
   
  
positive.code: ////////////////////////////////////////////////////////////////////////////////
  // eventy z dll knihovny:
  
  procedure TMTBIFace.OnLibBeforeOpen(Sender:TObject); stdcall;
   begin
    if (Assigned(Self.OnBeforeOpen)) then Self.OnBeforeOpen(Self);
   end;
  
  procedure TMTBIFace.OnLibAfterOpen(Sender:TObject); stdcall;
   begin
    if (Assigned(Self.OnAfterOpen)) then Self.OnAfterOpen(Self);
   end;
  
  procedure TMTBIFace.OnLibBeforeClose(Sender:TObject); stdcall;
   begin
    if (Assigned(Self.OnBeforeClose)) then Self.OnBeforeClose(Self);
   end;
  
  procedure TMTBIFace.OnLibAfterClose(Sender:TObject); stdcall;
   begin
    if (Assigned(Self.OnAfterClose)) then Self.OnAfterClose(Self);
   end;
  
  procedure TMTBIFace.OnLibBeforeStart(Sender:TObject); stdcall;
   begin
    if (Assigned(Self.OnBeforeStart)) then Self.OnBeforeStart(Self);
   end;
  
  procedure TMTBIFace.OnLibAfterStart(Sender:TObject); stdcall;
   begin
    if (Assigned(Self.OnAfterStart)) then Self.OnAfterStart(Self);
   end;
  
  procedure TMTBIFace.OnLibBeforeStop(Sender:TObject); stdcall;
   begin
    if (Assigned(Self.OnBeforeStop)) then Self.OnBeforeStop(Self);
   end;
  
  procedure TMTBIFace.OnLibAfterStop(Sender:TObject); stdcall;
   begin
    if (Assigned(Self.OnAfterStop)) then Self.OnAfterStop(Self);
   end;
  
  procedure TMTBIFace.OnLibError(Sender: TObject; errValue: word; errAddr: byte; errMsg:string); stdcall;
   begin
    if (Assigned(Self.OnError)) then Self.OnLibError(Self, errValue, errAddr, errMsg);
   end;
  
  procedure TMTBIFace.OnLibInputChanged(Sender: TObject; board:byte); stdcall;
   begin
    if (Assigned(Self.OnInputChanged)) then Self.OnInputChanged(Self, board);
   end;
  
  procedure TMTBIFace.OnLibOutputChanged(Sender: TObject; board:byte); stdcall;
   begin
    if (Assigned(Self.OnOutputChanged)) then Self.OnOutputChanged(Self, board);
   end;
  
  ////////////////////////////////////////////////////////////////////////////////
  
negative.code: 
    // assign events:
    setterNotify := GetProcAddress(FLib, 'setbeforeopen');
    if (Assigned(setterNotify)) then setterNotify(OnLibBeforeOpen, self);
    @setterNotify := GetProcAddress(FLib, 'setafteropen');
    if (Assigned(setterNotify)) then setterNotify(OnLibAfterOpen, self);
    @setterNotify := GetProcAddress(FLib, 'setbeforeclose');
    if (Assigned(setterNotify)) then setterNotify(OnLibBeforeClose, self);
    @setterNotify := GetProcAddress(FLib, 'setafterclose');
    if (Assigned(setterNotify)) then setterNotify(OnLibAfterClose, self);
  
    @setterNotify := GetProcAddress(FLib, 'setbeforestart');
    if (Assigned(setterNotify)) then setterNotify(OnLibBeforeStart, self);
    @setterNotify := GetProcAddress(FLib, 'setafterstart');
    if (Assigned(setterNotify)) then setterNotify(OnLibAfterStart, self);
    @setterNotify := GetProcAddress(FLib, 'setbeforestop');
    if (Assigned(setterNotify)) then setterNotify(OnLibBeforeStop, self);
    @setterNotify := GetProcAddress(FLib, 'setafterstop');
    if (Assigned(setterNotify)) then setterNotify(OnLibafterStop, self);
  
    @setterErr := GetProcAddress(FLib, 'setonerror');
    if (Assigned(setterErr)) then setterErr(OnLibError, self);
  
    @setterModuleChanged := GetProcAddress(FLib, 'setoninputchange');
    if (Assigned(setterModuleChanged)) then setterModuleChanged(OnLibInputChanged, self);
    @setterModuleChanged := GetProcAddress(FLib, 'setonoutputchange');
    if (Assigned(setterModuleChanged)) then setterModuleChanged(OnLibOutputChanged, self);
   end;
  
  ////////////////////////////////////////////////////////////////////////////////
  