anchor.diff:  
     // assign events:
     setterNotify := GetProcAddress(FLib, 'setbeforeopen');
  -  if (Assigned(setterNotify)) then setterNotify(OnLibBeforeOpen);
  +  if (Assigned(setterNotify)) then setterNotify(OnLibBeforeOpen, self);
     @setterNotify := GetProcAddress(FLib, 'setafteropen');
  -  if (Assigned(setterNotify)) then setterNotify(OnLibAfterOpen);
  +  if (Assigned(setterNotify)) then setterNotify(OnLibAfterOpen, self);
     @setterNotify := GetProcAddress(FLib, 'setbeforeclose');
  -  if (Assigned(setterNotify)) then setterNotify(OnLibBeforeClose);
  +  if (Assigned(setterNotify)) then setterNotify(OnLibBeforeClose, self);
     @setterNotify := GetProcAddress(FLib, 'setafterclose');
  -  if (Assigned(setterNotify)) then setterNotify(OnLibAfterClose);
  +  if (Assigned(setterNotify)) then setterNotify(OnLibAfterClose, self);
   
     @setterNotify := GetProcAddress(FLib, 'setbeforestart');
  -  if (Assigned(setterNotify)) then setterNotify(OnLibBeforeStart);
  +  if (Assigned(setterNotify)) then setterNotify(OnLibBeforeStart, self);
     @setterNotify := GetProcAddress(FLib, 'setafterstart');
  -  if (Assigned(setterNotify)) then setterNotify(OnLibAfterStart);
  +  if (Assigned(setterNotify)) then setterNotify(OnLibAfterStart, self);
     @setterNotify := GetProcAddress(FLib, 'setbeforestop');
  -  if (Assigned(setterNotify)) then setterNotify(OnLibBeforeStop);
  +  if (Assigned(setterNotify)) then setterNotify(OnLibBeforeStop, self);
     @setterNotify := GetProcAddress(FLib, 'setafterstop');
  -  if (Assigned(setterNotify)) then setterNotify(OnLibafterStop);
  +  if (Assigned(setterNotify)) then setterNotify(OnLibafterStop, self);
   
     @setterErr := GetProcAddress(FLib, 'setonerror');
  -  if (Assigned(setterErr)) then setterErr(OnLibError);
  +  if (Assigned(setterErr)) then setterErr(OnLibError, self);
   
     @setterModuleChanged := GetProcAddress(FLib, 'setoninputchange');
  -  if (Assigned(setterModuleChanged)) then setterModuleChanged(OnLibInputChanged);
  +  if (Assigned(setterModuleChanged)) then setterModuleChanged(OnLibInputChanged, self);
     @setterModuleChanged := GetProcAddress(FLib, 'setonoutputchange');
  -  if (Assigned(setterModuleChanged)) then setterModuleChanged(OnLibOutputChanged);
  +  if (Assigned(setterModuleChanged)) then setterModuleChanged(OnLibOutputChanged, self);
    end;
   
   ////////////////////////////////////////////////////////////////////////////////
  
positive.code:   TDllModuleChanedEvent = procedure (Sender:TObject; module:byte) of object;
  
    // prototypy callback funkci z knihivny do TMTBIFace:
    TStdNotifyEvent = procedure (Sender: TObject) of object; stdcall;
    TStdDllErrEvent = procedure (Sender: TObject; errValue: word; errAddr: byte; errMsg:string) of object; stdcall;
    TStdDllModuleChanedEvent = procedure (Sender:TObject; module:byte) of object; stdcall;
  
    // prototypy setteru (funkci naastavujicich callback funkce) z TMTBIFace do dll knihovny:
    TSetDllNotifyEvent = procedure(func:TStdNotifyEvent); stdcall;
    TSetDllErrEvent = procedure(func:TStdDllErrEvent); stdcall;
    TSetDllEventChange = procedure (func:TStdDllModuleChanedEvent); stdcall;
  
    // vlastni vyjimky:
    EFuncNotAssigned = class(Exception);
  
negative.code: ////////////////////////////////////////////////////////////////////////////////
  // eventy z dll knihovny:
  
  procedure OnLibBeforeOpen(Sender:TObject; data:Pointer); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnBeforeOpen)) then TMTBIFace(data).OnBeforeOpen(TMTBIFace(data));
   end;
  
  procedure OnLibAfterOpen(Sender:TObject; data:Pointer); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnAfterOpen)) then TMTBIFace(data).OnAfterOpen(TMTBIFace(data));
   end;
  
  procedure OnLibBeforeClose(Sender:TObject; data:Pointer); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnBeforeClose)) then TMTBIFace(data).OnBeforeClose(TMTBIFace(data));
   end;
  
  procedure OnLibAfterClose(Sender:TObject; data:Pointer); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnAfterClose)) then TMTBIFace(data).OnAfterClose(TMTBIFace(data));
   end;
  
  procedure OnLibBeforeStart(Sender:TObject; data:Pointer); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnBeforeStart)) then TMTBIFace(data).OnBeforeStart(TMTBIFace(data));
   end;
  
  procedure OnLibAfterStart(Sender:TObject; data:Pointer); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnAfterStart)) then TMTBIFace(data).OnAfterStart(TMTBIFace(data));
   end;
  
  procedure OnLibBeforeStop(Sender:TObject; data:Pointer); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnBeforeStop)) then TMTBIFace(data).OnBeforeStop(TMTBIFace(data));
   end;
  
  procedure OnLibAfterStop(Sender:TObject; data:Pointer); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnAfterStop)) then TMTBIFace(data).OnAfterStop(TMTBIFace(data));
   end;
  
  procedure OnLibError(Sender: TObject; data:Pointer; errValue: word; errAddr: byte; errMsg:string); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnError)) then TMTBIFace(data).OnError(TMTBIFace(data), errValue, errAddr, errMsg);
   end;
  
  procedure OnLibInputChanged(Sender: TObject; data:Pointer; board:byte); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnInputChanged)) then TMTBIFace(data).OnInputChanged(TMTBIFace(data), board);
   end;
  
  procedure OnLibOutputChanged(Sender: TObject; data:Pointer; board:byte); stdcall;
   begin
    if (Assigned(TMTBIFace(data).OnOutputChanged)) then TMTBIFace(data).OnOutputChanged(TMTBIFace(data), board);
   end;
  
  ////////////////////////////////////////////////////////////////////////////////
  