Solved

How do I deal with an Interface type returned by a function in a Type Libary

Posted on 2009-03-29
3
1,747 Views
Last Modified: 2013-12-03
I've got a vendor supplied DLL that implements an interface to an external hardware device.  

My problem is that this type library contains functions that return interfaces rather than instantiated objects that I can manipulate.  I'm trying to set and read the time on the device in question, and in order to do so, I need to call 3 functions;

1. RetrieveMAConfig() - Returns an interface to other functions which I need to call
2. SetDateTimeConf() to set the time
3. GetParam() to read the time

The following code compiles, but it results in an access violation if I do anything further with options:

procedure DoSomething;
var
  terminal : TMATerminal;
  result : integer;
  options : IMAOptions;

begin
  terminal := TMATerminal.Create(nil);

  terminal.SetParam('IPADRESS', '192.168.73.244');
  terminal.SetParam('PORTNUMBER', 11010);

  result := terminal.RetrieveMAConfig(options, 5000, 1);

  // Access violation follows
  options.SetDateTimeConf('010110121000');
end;

My question is, how do I deal with this interface returned by RetrieveMAConfig()?  I'm fairly new to COM programming, and I've never come across a DLL that returns an interface like this.

Specifically, how do I call options.SetDateTimeConf('010110121000') so that I don't get an access violation?
 
Function declarations:
---------------------------
RetrieveMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer; WiegandOrDC: Integer): Smallint;
SetDateTimeConf(const DateTime: WideString); safecall;
GetParam(const ParamName: WideString; var Value: OleVariant); safecall;

I've attached the delphi generated TLB file below:
unit ACTIVE_MACILib_TLB;
 

// ************************************************************************ //

// WARNING                                                                    

// -------                                                                    

// The types declared in this file were generated from data read from a       

// Type Library. If this type library is explicitly or indirectly (via        

// another type library referring to this type library) re-imported, or the   

// 'Refresh' command of the Type Library Editor activated while editing the   

// Type Library, the contents of this file will be regenerated and all        

// manual modifications will be lost.                                         

// ************************************************************************ //
 

// $Rev: 8291 $

// File generated on 16/03/2009 3:47:18 p.m. from Type Library described below.
 

// ************************************************************************  //

// Type Lib: C:\SAGEM\Morpho Components\Active_MACI\lib\Active_MACI.dll (1)

// LIBID: {F2165BA4-8A7F-4438-B48B-C3C921ADD904}

// LCID: 0

// Helpfile: 

// HelpString: Active_MACI 1.0 Type Library

// DepndLst: 

//   (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)

// Errors:

//   Hint: Parameter 'Private' of IMADB.AddField changed to 'Private_'

//   Hint: Parameter 'Record' of IMATerminal.AddRecord changed to 'Record_'

//   Hint: Parameter 'Record' of IMATerminal.RemoveRecord changed to 'Record_'

// ************************************************************************ //

// *************************************************************************//

// NOTE:                                                                      

// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties  

// which return objects that may need to be explicitly created via a function 

// call prior to any access via the property. These items have been disabled  

// in order to prevent accidental use from within the object inspector. You   

// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively   

// removing them from the $IFDEF blocks. However, such items must still be    

// programmatically created via a method of the appropriate CoClass before    

// they can be used.                                                          

{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 

{$WARN SYMBOL_PLATFORM OFF}

{$WRITEABLECONST ON}

{$VARPROPSETTER ON}

interface
 

uses Windows, ActiveX, Classes, Graphics, OleServer, StdVCL, Variants;

  
 

// *********************************************************************//

// GUIDS declared in the TypeLibrary. Following prefixes are used:        

//   Type Libraries     : LIBID_xxxx                                      

//   CoClasses          : CLASS_xxxx                                      

//   DISPInterfaces     : DIID_xxxx                                       

//   Non-DISP interfaces: IID_xxxx                                        

// *********************************************************************//

const

  // TypeLibrary Major and minor versions

  ACTIVE_MACILibMajorVersion = 1;

  ACTIVE_MACILibMinorVersion = 0;
 

  LIBID_ACTIVE_MACILib: TGUID = '{F2165BA4-8A7F-4438-B48B-C3C921ADD904}';
 

  IID_IMADB: TGUID = '{09EC1A0D-110F-43F0-B239-D381239BF3EC}';

  CLASS_MADB: TGUID = '{2E9D2D26-C23F-41DA-BB63-E3E24CB09452}';

  IID_IMARecord: TGUID = '{72888AD7-0605-496D-9F8C-E7D79A3F8CEA}';

  IID_IMADBReport: TGUID = '{E960E9B1-5CA8-4266-AFCD-4A508A461F5E}';

  CLASS_MADBReport: TGUID = '{43EAB047-00AD-4756-AA04-9D47F4EE9E1C}';

  IID_IMALogReport: TGUID = '{BD2B4865-41B5-4F22-AEA3-25B492B66313}';

  CLASS_MALogReport: TGUID = '{483523F4-6F55-4342-9879-D319643555E4}';

  IID_IMALogs: TGUID = '{E5A8DA50-ED4A-4892-8183-4A2C31C12BCE}';

  CLASS_MALogs: TGUID = '{83D74537-6A08-4A5E-970C-DB2FA859F068}';

  IID_IMAOptions: TGUID = '{486F39E1-E6E8-4A6C-AC2C-2C936FA58A7E}';

  CLASS_MAOptions: TGUID = '{AA8522E7-E4DF-4C8B-8FB3-595EBDD3F951}';

  CLASS_MARecord: TGUID = '{BD7E3E65-7D36-45A5-B86E-2FA853A9A738}';

  IID_IMATerminal: TGUID = '{D92A279C-46AA-4908-9F4D-8BE4F6D2256A}';

  CLASS_MATerminal: TGUID = '{5960999D-2C1D-4781-8815-D1A363F0F5AA}';
 

// *********************************************************************//

// Declaration of Enumerations defined in Type Library                    

// *********************************************************************//

// Constants for enum MATYPES

type

  MATYPES = TOleEnum;

const

  MAUNKNOWN = $00000000;

  MA100 = $00000064;

  MA110 = $0000006E;

  MA120 = $00000078;

  MA121 = $00000079;

  MA200 = $000000C8;

  MA201 = $000000C9;

  MA220 = $000000DC;

  MA221 = $000000DD;

  MA300 = $0000012C;

  MA301 = $0000012D;

  MA320 = $00000140;

  MA321 = $00000141;

  MA5xx = $000001F4;

  MA500 = $000001F4;

  MA520 = $00000208;

  MA521 = $00000209;
 

// Constants for enum HOSTCOM

type

  HOSTCOM = TOleEnum;

const

  HC_STANDALONE = $00000000;

  HC_COM1 = $00000001;

  HC_COM2 = $00000002;

  HC_ETHERNET = $00000003;
 

// Constants for enum MODE

type

  MODE = TOleEnum;

const

  MODE_IDENT = $00000000;

  MODE_AUTHENT = $00000001;

  MODE_PROXY = $00000002;

  MODE_CNTLWODB = $00000003;

  MODE_CNTLWDB = $00000004;

  MODE_FUSION = $00000005;
 

// Constants for enum READER

type

  READER = TOleEnum;

const

  NOREADER = $00000000;

  DEISTER = $00000001;

  ACG = $00000002;

  KEYA = $00000001;

  KEYB = $00000002;
 

// Constants for enum PORTID

type

  PORTID = TOleEnum;

const

  IDCOM1 = $00000006;

  IDCOM2 = $00000007;

  IDWIEGAND = $00000009;

  IDDATACLOCK = $0000001B;
 

// Constants for enum COMSPEED

type

  COMSPEED = TOleEnum;

const

  _1200BDS = $00000000;

  _2400BDS = $00000001;

  _4800BDS = $00000002;

  _9600BDS = $00000003;

  _19200BDS = $00000004;

  _28800BDS = $00000005;

  _38400BDS = $00000006;

  _57600BDS = $00000007;

  _115200BDS = $00000008;
 

// Constants for enum COMPARITY

type

  COMPARITY = TOleEnum;

const

  PARITYNO = $00000000;

  PARITYODD = $00000001;

  PARITYEVEN = $00000002;
 

// Constants for enum COMFLOWCTRL

type

  COMFLOWCTRL = TOleEnum;

const

  FLOWCTRLNO = $00000000;

  FLOWCTRLRTSCTS = $00000001;

  FLOWCTRLXONOFF = $00000002;
 

// Constants for enum ComFormat

type

  ComFormat = TOleEnum;

const

  ASCIIFORMAT = $00000000;

  BINFORMAT = $00000001;

  BCDFORMAT = $00000002;
 

// Constants for enum DCLEVEL

type

  DCLEVEL = TOleEnum;

const

  DCLEVELNOINVERT = $00000000;

  DCLEVELSTROBEINVERT = $00000001;

  DCLEVELDATAINVERT = $00000002;

  DCLEVELALLINVERT = $00000003;
 

// Constants for enum WDCCONF

type

  WDCCONF = TOleEnum;

const

  WIEGANDCONF = $00000001;

  DATACLOCKCONF = $00000000;
 

// Constants for enum LANG

type

  LANG = TOleEnum;

const

  ENGLISH = $00000000;

  SPANISH = $00000001;

  FRENCH = $00000002;

  CUSTOMLANG = $00000003;
 

// Constants for enum BIOSTATUS

type

  BIOSTATUS = TOleEnum;

const

  BIO_OK = $00000000;

  BIO_NOT_OK = $00000001;

  LATENT_DETECTED = $00000002;

  FAKE_FINGER_DETECTED = $00000022;
 

// Constants for enum MAERROR

type

  MAERROR = TOleEnum;

const

  ILVOK = $00000000;

  WAIT_BIO = $00000001;

  BAD_IP_OR_PORT = $00000002;

  NO_CONNECTION = $00000003;

  NO_SENT = $00000004;

  BAD_RESPONSE_SIZE = $00000005;

  BAD_RESPONSE_TYPE = $00000006;

  MA_DESFIRE = $00000007;

  DOWNLOAD_STOP = $00000008;

  CALL_GETVERS = $00000009;

  ILVERROR = $FFFFFFFF;

  BADPARAM = $FFFFFFFE;

  INVALID_PK = $FFFFFFFD;

  INVALID_USER_ID = $FFFFFFFC;

  INVALID_USER_DATA = $FFFFFFFB;

  TIMEOUT = $FFFFFFFA;

  INVALID_ID_PROT = $FFFFFFF9;

  ALREADY_ENR = $FFFFFFF8;

  BASE_NOT_FOUND = $FFFFFFF7;

  BASE_ALREADY_EXISTS = $FFFFFFF6;

  BIO_PROGRESS = $FFFFFFF5;

  CMD_PROGRESS = $FFFFFFF4;

  FLASH_INVALID = $FFFFFFF3;

  NO_SPACE_LEFT = $FFFFFFF2;

  ADMIN_EXEC = $FFFFFFF1;

  BAD_SIGNATURE = $FFFFFFF0;

  CARD_PB = $FFFFFFEF;

  ERROR_SL = $FFFFFFEE;

  ERROR_WIEGAND = $FFFFFFED;

  ERROR_NETWORK = $FFFFFFEC;

  OUT_OF_FIELD = $FFFFFFEB;

  INVALID_ACCESS = $FFFFFFEA;

  FIELD_NOT_FOUND = $FFFFFFE9;

  FIELD_INVALID = $FFFFFFE8;

  SECURITY_MODE = $FFFFFFE7;

  ILV_NOT_IMPLEMENT = $FFFFFF9D;
 

type
 

// *********************************************************************//

// Forward declaration of types defined in TypeLibrary                    

// *********************************************************************//

  IMADB = interface;

  IMADBDisp = dispinterface;

  IMARecord = interface;

  IMARecordDisp = dispinterface;

  IMADBReport = interface;

  IMADBReportDisp = dispinterface;

  IMALogReport = interface;

  IMALogReportDisp = dispinterface;

  IMALogs = interface;

  IMALogsDisp = dispinterface;

  IMAOptions = interface;

  IMAOptionsDisp = dispinterface;

  IMATerminal = interface;

  IMATerminalDisp = dispinterface;
 

// *********************************************************************//

// Declaration of CoClasses defined in Type Library                       

// (NOTE: Here we map each CoClass to its Default Interface)              

// *********************************************************************//

  MADB = IMADB;

  MADBReport = IMADBReport;

  MALogReport = IMALogReport;

  MALogs = IMALogs;

  MAOptions = IMAOptions;

  MARecord = IMARecord;

  MATerminal = IMATerminal;
 
 

// *********************************************************************//

// Declaration of structures, unions and aliases.                         

// *********************************************************************//

  POleVariant1 = ^OleVariant; {*}

  PWideString1 = ^WideString; {*}

  PSmallint1 = ^Smallint; {*}

  PInteger1 = ^Integer; {*}

  PSYSINT1 = ^SYSINT; {*}

  PUINT1 = ^LongWord; {*}
 
 

// *********************************************************************//

// Interface: IMADB

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {09EC1A0D-110F-43F0-B239-D381239BF3EC}

// *********************************************************************//

  IMADB = interface(IDispatch)

    ['{09EC1A0D-110F-43F0-B239-D381239BF3EC}']

    procedure AddField(const FieldName: WideString; FieldSize: Smallint; Private_: Integer); safecall;

    procedure Create; safecall;

    procedure Reset; safecall;

    procedure Save; safecall;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); safecall;

    procedure AddRecord(const PersonRec: IMARecord); safecall;

    procedure GetDataBaseField(FieldIndex: Smallint; var FieldName: WideString; 

                               var FieldSize: Smallint); safecall;

    procedure SetAllParam(DBID: Smallint; NBFinger: Smallint; MAType: Smallint; 

                          NBPersonInBase: SYSINT; MAVersion: SYSINT); safecall;

    procedure SaveToFile(const MBBioPath: WideString); safecall;

    procedure SaveToFileAndMA(const MBBioPath: WideString); safecall;

    procedure GetMADB(o_MADB: LongWord); safecall;

  end;
 

// *********************************************************************//

// DispIntf:  IMADBDisp

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {09EC1A0D-110F-43F0-B239-D381239BF3EC}

// *********************************************************************//

  IMADBDisp = dispinterface

    ['{09EC1A0D-110F-43F0-B239-D381239BF3EC}']

    procedure AddField(const FieldName: WideString; FieldSize: Smallint; Private_: Integer); dispid 1;

    procedure Create; dispid 2;

    procedure Reset; dispid 3;

    procedure Save; dispid 4;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); dispid 5;

    procedure AddRecord(const PersonRec: IMARecord); dispid 6;

    procedure GetDataBaseField(FieldIndex: Smallint; var FieldName: WideString; 

                               var FieldSize: Smallint); dispid 7;

    procedure SetAllParam(DBID: Smallint; NBFinger: Smallint; MAType: Smallint; 

                          NBPersonInBase: SYSINT; MAVersion: SYSINT); dispid 8;

    procedure SaveToFile(const MBBioPath: WideString); dispid 9;

    procedure SaveToFileAndMA(const MBBioPath: WideString); dispid 10;

    procedure GetMADB(o_MADB: LongWord); dispid 11;

  end;
 

// *********************************************************************//

// Interface: IMARecord

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {72888AD7-0605-496D-9F8C-E7D79A3F8CEA}

// *********************************************************************//

  IMARecord = interface(IDispatch)

    ['{72888AD7-0605-496D-9F8C-E7D79A3F8CEA}']

    procedure AddFinger(PK: OleVariant; Position: Smallint); safecall;

    procedure RemoveFinger(Position: Smallint); safecall;

    procedure AddUserData(const FieldName: WideString; Data: OleVariant); safecall;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); safecall;

    procedure SetParam(const ParamName: WideString; Value: OleVariant); safecall;

    procedure GetUserData(DataIndex: Smallint; var FieldName: WideString; var Value: OleVariant); safecall;

    procedure Clean; safecall;

  end;
 

// *********************************************************************//

// DispIntf:  IMARecordDisp

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {72888AD7-0605-496D-9F8C-E7D79A3F8CEA}

// *********************************************************************//

  IMARecordDisp = dispinterface

    ['{72888AD7-0605-496D-9F8C-E7D79A3F8CEA}']

    procedure AddFinger(PK: OleVariant; Position: Smallint); dispid 1;

    procedure RemoveFinger(Position: Smallint); dispid 2;

    procedure AddUserData(const FieldName: WideString; Data: OleVariant); dispid 3;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); dispid 4;

    procedure SetParam(const ParamName: WideString; Value: OleVariant); dispid 5;

    procedure GetUserData(DataIndex: Smallint; var FieldName: WideString; var Value: OleVariant); dispid 6;

    procedure Clean; dispid 7;

  end;
 

// *********************************************************************//

// Interface: IMADBReport

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {E960E9B1-5CA8-4266-AFCD-4A508A461F5E}

// *********************************************************************//

  IMADBReport = interface(IDispatch)

    ['{E960E9B1-5CA8-4266-AFCD-4A508A461F5E}']

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); safecall;

    procedure SetParam(const ParamName: WideString; Value: OleVariant); safecall;

  end;
 

// *********************************************************************//

// DispIntf:  IMADBReportDisp

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {E960E9B1-5CA8-4266-AFCD-4A508A461F5E}

// *********************************************************************//

  IMADBReportDisp = dispinterface

    ['{E960E9B1-5CA8-4266-AFCD-4A508A461F5E}']

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); dispid 1;

    procedure SetParam(const ParamName: WideString; Value: OleVariant); dispid 2;

  end;
 

// *********************************************************************//

// Interface: IMALogReport

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {BD2B4865-41B5-4F22-AEA3-25B492B66313}

// *********************************************************************//

  IMALogReport = interface(IDispatch)

    ['{BD2B4865-41B5-4F22-AEA3-25B492B66313}']

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); safecall;

    procedure SetParam(const UserParamName: WideString; Value: OleVariant); safecall;

  end;
 

// *********************************************************************//

// DispIntf:  IMALogReportDisp

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {BD2B4865-41B5-4F22-AEA3-25B492B66313}

// *********************************************************************//

  IMALogReportDisp = dispinterface

    ['{BD2B4865-41B5-4F22-AEA3-25B492B66313}']

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); dispid 1;

    procedure SetParam(const UserParamName: WideString; Value: OleVariant); dispid 2;

  end;
 

// *********************************************************************//

// Interface: IMALogs

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {E5A8DA50-ED4A-4892-8183-4A2C31C12BCE}

// *********************************************************************//

  IMALogs = interface(IDispatch)

    ['{E5A8DA50-ED4A-4892-8183-4A2C31C12BCE}']

    procedure SaveBinaryLogs(const FileName: WideString; Concat: Integer); safecall;

    procedure SaveTextLogs(const FileName: WideString; Concat: Integer); safecall;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); safecall;

    procedure SetParam(const ParamName: WideString; Value: OleVariant); safecall;

  end;
 

// *********************************************************************//

// DispIntf:  IMALogsDisp

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {E5A8DA50-ED4A-4892-8183-4A2C31C12BCE}

// *********************************************************************//

  IMALogsDisp = dispinterface

    ['{E5A8DA50-ED4A-4892-8183-4A2C31C12BCE}']

    procedure SaveBinaryLogs(const FileName: WideString; Concat: Integer); dispid 1;

    procedure SaveTextLogs(const FileName: WideString; Concat: Integer); dispid 2;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); dispid 3;

    procedure SetParam(const ParamName: WideString; Value: OleVariant); dispid 4;

  end;
 

// *********************************************************************//

// Interface: IMAOptions

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {486F39E1-E6E8-4A6C-AC2C-2C936FA58A7E}

// *********************************************************************//

  IMAOptions = interface(IDispatch)

    ['{486F39E1-E6E8-4A6C-AC2C-2C936FA58A7E}']

    procedure SetAppConf(HOSTCOM: Smallint; MODE: Smallint; LogFile: Integer; AdminIdent: Integer; 

                         TimeMask: Integer); safecall;

    procedure SetCntlCardConf(ReaderType: Smallint; B: Smallint; N: Smallint; C: Smallint; 

                              MODE: Smallint); safecall;

    procedure SetDateTimeConf(const DateTime: WideString); safecall;

    procedure SetGUIConf(ChangeLanguage: Integer; DisplayHour: Integer; WelcomeField1: Smallint; 

                         WelcomeField2: Smallint; IdleTime: Smallint); safecall;

    procedure SetLanguageConf(Language: Smallint); safecall;

    procedure SetNetWorkConf(const IpAdress: WideString; const Subnet: WideString; 

                             const Gateway: WideString); safecall;

    procedure SetRelayConf(MODE: Integer; TIMEOUT: Integer); safecall;

    procedure SetSerialLinkConf(IdPort: Smallint; speed: Smallint; databits: Smallint; 

                                stopbits: Smallint; parity: Smallint; flowcontrol: Smallint; 

                                send: Integer; format: Smallint); safecall;

    procedure SetWiDCConf(ID: Smallint; send: Integer); safecall;

    procedure SetWiDCOptionsConf(FacilityCode: Smallint; DataClockLevel: Smallint; LedIn: Integer; 

                                 LedOutCardPresent: Integer); safecall;

    procedure Reset; safecall;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); safecall;

    procedure SetFFDConf(LogEvents: Smallint; SendID: Smallint; Delay: Integer; 

                         PresDetect: Smallint; WDCId: Smallint; SecureLevel: Smallint); safecall;

  end;
 

// *********************************************************************//

// DispIntf:  IMAOptionsDisp

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {486F39E1-E6E8-4A6C-AC2C-2C936FA58A7E}

// *********************************************************************//

  IMAOptionsDisp = dispinterface

    ['{486F39E1-E6E8-4A6C-AC2C-2C936FA58A7E}']

    procedure SetAppConf(HOSTCOM: Smallint; MODE: Smallint; LogFile: Integer; AdminIdent: Integer; 

                         TimeMask: Integer); dispid 1;

    procedure SetCntlCardConf(ReaderType: Smallint; B: Smallint; N: Smallint; C: Smallint; 

                              MODE: Smallint); dispid 2;

    procedure SetDateTimeConf(const DateTime: WideString); dispid 3;

    procedure SetGUIConf(ChangeLanguage: Integer; DisplayHour: Integer; WelcomeField1: Smallint; 

                         WelcomeField2: Smallint; IdleTime: Smallint); dispid 4;

    procedure SetLanguageConf(Language: Smallint); dispid 5;

    procedure SetNetWorkConf(const IpAdress: WideString; const Subnet: WideString; 

                             const Gateway: WideString); dispid 6;

    procedure SetRelayConf(MODE: Integer; TIMEOUT: Integer); dispid 7;

    procedure SetSerialLinkConf(IdPort: Smallint; speed: Smallint; databits: Smallint; 

                                stopbits: Smallint; parity: Smallint; flowcontrol: Smallint; 

                                send: Integer; format: Smallint); dispid 8;

    procedure SetWiDCConf(ID: Smallint; send: Integer); dispid 9;

    procedure SetWiDCOptionsConf(FacilityCode: Smallint; DataClockLevel: Smallint; LedIn: Integer; 

                                 LedOutCardPresent: Integer); dispid 10;

    procedure Reset; dispid 11;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); dispid 12;

    procedure SetFFDConf(LogEvents: Smallint; SendID: Smallint; Delay: Integer; 

                         PresDetect: Smallint; WDCId: Smallint; SecureLevel: Smallint); dispid 13;

  end;
 

// *********************************************************************//

// Interface: IMATerminal

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {D92A279C-46AA-4908-9F4D-8BE4F6D2256A}

// *********************************************************************//

  IMATerminal = interface(IDispatch)

    ['{D92A279C-46AA-4908-9F4D-8BE4F6D2256A}']

    function AccessOK(TIMEOUT: Integer; GreenLigth: Integer): Smallint; safecall;

    function Authenticate(const IRec: IMARecord; MatchThreshold: Smallint; qualThreshold: Smallint; 

                          var Result: Smallint; TIMEOUT: Integer; ConnectionTimeOut: Integer; 

                          AuthentTimeOut: Integer): Smallint; safecall;

    function DefaultInit(TIMEOUT: Integer; KeepSettings: Integer): Smallint; safecall;

    function EraseAllDBs(TIMEOUT: Integer): Smallint; safecall;

    function GarbageCollector(TIMEOUT: Integer; DBID: Smallint): Smallint; safecall;

    function RetrieveVersion(TIMEOUT: Integer): Smallint; safecall;

    function Identify(DBID: Smallint; MatchThreshold: Smallint; TIMEOUT: Integer; 

                      var Result: Smallint; var UserIndex: Integer; var UserId: WideString; 

                      ConnectionTimeOut: Integer): Smallint; safecall;

    function Ping(TIMEOUT: Integer): Smallint; safecall;

    function PrintScreen(PositionX: Smallint; PositionY: Smallint; const Message: WideString; 

                         TIMEOUT: Integer): Smallint; safecall;

    function ReadFromKeyBoard(InputTime: Integer; const Prompt: WideString; var Rep: WideString; 

                              TIMEOUT: Integer): Smallint; safecall;

    function Reboot(TIMEOUT: Integer): Smallint; safecall;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); safecall;

    procedure SetParam(const ParamName: WideString; Value: OleVariant); safecall;

    function Enrol(const IRec: IMARecord; DBID: Smallint; EnrolType: Integer; NBFinger: Smallint; 

                   SaveRec: Integer; ExportPK: Smallint; var EnrolStatus: Smallint; 

                   var UserDBIndex: Integer; TIMEOUT: Integer; ConnectionTimeOut: Integer): Smallint; safecall;

    function CreateDB(const DataBase: IMADB; TIMEOUT: Integer): Smallint; safecall;

    function EraseDB(const DataBase: IMADB; TIMEOUT: Integer): Smallint; safecall;

    function DownloadDB(const DataBase: IMADB; NbRetry: Smallint; var Stop: Integer; 

                        TIMEOUT: Integer): Smallint; safecall;

    function AddRecord(const DataBase: IMADB; const Record_: IMARecord; var Status: Smallint; 

                       var UserIndex: Integer; TIMEOUT: Integer): Smallint; safecall;

    function RemoveRecord(const DataBase: IMADB; const Record_: IMARecord; TIMEOUT: Integer): Smallint; safecall;

    function RetrieveMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer; WiegandOrDC: Integer): Smallint; safecall;

    function SendMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer): Smallint; safecall;

    function RetrieveLogConfig(DBID: Smallint; const LogConfig: IMALogReport; TIMEOUT: Integer; 

                               NbRetry: Smallint): Smallint; safecall;

    function RetrieveLogs(DBID: Smallint; const Logs: IMALogs; TIMEOUT: Integer; NbRetry: Smallint): Smallint; safecall;

    function RetrieveAllDBReports(TabDBReport: PSafeArray; var NbBase: Smallint; TIMEOUT: Integer): Smallint; safecall;

    function EraseLogs(DBID: Smallint; TIMEOUT: Integer): Smallint; safecall;

    function RetrieveMADBReport(DBID: Smallint; const Ireport: IMADBReport; TIMEOUT: Integer): Smallint; safecall;

    function OpenDistantSession(TIMEOUT: Integer): Smallint; safecall;

    function CloseDistantSession(TIMEOUT: Integer): Smallint; safecall;

    function SetContactlessKey(TIMEOUT: Integer; KeyNumber: Smallint; SectorNum: Smallint; 

                               KeySector: OleVariant): Smallint; safecall;

    function RetrieveKeyVersion(KeyNumber: Smallint; KeyStatus: Smallint; TIMEOUT: Integer; 

                                var response: Smallint; var KeyVersion: Smallint; 

                                var OperationDate: WideString; var KeyPeriod: Smallint): Smallint; safecall;

    function EraseAllKeys(TIMEOUT: Integer; var response: Smallint): Smallint; safecall;

    function EraseKey(KeyNumber: Smallint; KeyVersion: Smallint; TIMEOUT: Integer; 

                      var response: Smallint): Smallint; safecall;

    function SetRegistryKey(const KeyName: WideString; const KeyValue: WideString; TIMEOUT: Integer): Smallint; safecall;

    function RetrieveRegistryKey(const KeyName: WideString; var KeyValue: OleVariant; 

                                 TIMEOUT: Integer): Smallint; safecall;

    function UpdateMASoftware(const SoftPath: WideString; TIMEOUT: Integer): Smallint; safecall;

    function SendExtendedCommand(const ExtCmd: WideString; TIMEOUT: Integer): Smallint; safecall;

    function FindUser(DBID: Smallint; FieldIndex: Integer; RecOffset: Integer; 

                      UserData: OleVariant; var RecIndex: Integer; TIMEOUT: Integer): Smallint; safecall;

    function GetData(DBID: Smallint; FieldIndex: Integer; UserId: OleVariant; 

                     var ReturnData: OleVariant; TIMEOUT: Integer): Smallint; safecall;

    function GetPublicField(DBID: Smallint; FieldIndex: Integer; ReturnData: PSafeArray; 

                            TIMEOUT: Integer): Smallint; safecall;

    function UpdatePublicData(BDID: Smallint; ListOfField: PSafeArray; TIMEOUT: Integer): Smallint; safecall;

    function ChangePwd(PwdID: Smallint; const OldPwd: WideString; const NewPwd: WideString; 

                       TIMEOUT: Integer): Smallint; safecall;

    function RetrieveRegistryFile(const RegPath: WideString; TIMEOUT: Integer): Smallint; safecall;

    function RetrieveVersionEtendue(TIMEOUT: Integer): Smallint; safecall;

    function DisplayScreen(imageId: Smallint; attrib_1: Smallint; const line_1: WideString; 

                           attrib_2: Smallint; const line_2: WideString; attrib_3: Smallint; 

                           const line_3: WideString; i_TimeOut: Integer): Smallint; safecall;

    function SetTerminalKey(const maKey: WideString; TIMEOUT: Integer): Smallint; safecall;

    function ReadInput(var o_inputContent: OleVariant; cmdId: Smallint; maxInputChar: Smallint; 

                       imageId: Smallint; attrib_1: Smallint; line_1: OleVariant; lineId: Smallint; 

                       TIMEOUT: Integer): Smallint; safecall;

    function DataSend(line_1: OleVariant; TIMEOUT: Integer): Smallint; safecall;

    function EraseLanguageFile(line_1: OleVariant; listIndex: Integer; TIMEOUT: Integer): Smallint; safecall;

    function LoadLanguageFile(FileName: OleVariant; NbRetry: SYSINT; TIMEOUT: Integer): Smallint; safecall;

    function AddSeveralRecords(const DataBase: IMADB; NbRetry: Smallint; var Stop: Integer; 

                               TIMEOUT: Integer): Smallint; safecall;

    function setComMode(i_e_comMode: SYSINT): SYSINT; safecall;

    function getComMode: SYSINT; safecall;

    function initSSL(const i_bstr_passphrase: WideString): SYSINT; safecall;

    function executeRequestFile(const i_cs_REQfilename: WideString; 

                                const i_cs_REPfilename: WideString; i_i_timeout: SYSINT): SYSINT; safecall;

    function cmdDir(const i_pc_diskName: WideString; var o_pv_data: OleVariant; 

                    var o_pi_length: SYSINT): SYSINT; safecall;

    function SetMultipleRegistryKey(i_i_numberOfKeys: SYSINT; i_px_keys: PSafeArray; 

                                    i_i_timeout: SYSINT): SYSINT; safecall;

    function SetMIFAREKey(TIMEOUT: Integer; KeyNumber: Smallint; SectorNum: Smallint; 

                          KeySector: OleVariant): Smallint; safecall;

    function SendCustomCommand(const i_cs_RequestString: WideString; 

                               var o_cs_ReplyString: WideString; var i_replyLength: LongWord; 

                               i_i_timeout: Integer): Smallint; safecall;

    procedure SpecialRequest(i_i_RequestType: SYSINT; var i_pv_DataIn: OleVariant; 

                             i_i_DataInLength: SYSINT; var o_pv_DataOut: OleVariant; 

                             var i_pi_DataOutLength: SYSINT); safecall;

    procedure GetLicenseStatus(var o_hLicenseStatus: SYSINT); safecall;

  end;
 

// *********************************************************************//

// DispIntf:  IMATerminalDisp

// Flags:     (4416) Dual OleAutomation Dispatchable

// GUID:      {D92A279C-46AA-4908-9F4D-8BE4F6D2256A}

// *********************************************************************//

  IMATerminalDisp = dispinterface

    ['{D92A279C-46AA-4908-9F4D-8BE4F6D2256A}']

    function AccessOK(TIMEOUT: Integer; GreenLigth: Integer): Smallint; dispid 1;

    function Authenticate(const IRec: IMARecord; MatchThreshold: Smallint; qualThreshold: Smallint; 

                          var Result: Smallint; TIMEOUT: Integer; ConnectionTimeOut: Integer; 

                          AuthentTimeOut: Integer): Smallint; dispid 2;

    function DefaultInit(TIMEOUT: Integer; KeepSettings: Integer): Smallint; dispid 3;

    function EraseAllDBs(TIMEOUT: Integer): Smallint; dispid 4;

    function GarbageCollector(TIMEOUT: Integer; DBID: Smallint): Smallint; dispid 5;

    function RetrieveVersion(TIMEOUT: Integer): Smallint; dispid 6;

    function Identify(DBID: Smallint; MatchThreshold: Smallint; TIMEOUT: Integer; 

                      var Result: Smallint; var UserIndex: Integer; var UserId: WideString; 

                      ConnectionTimeOut: Integer): Smallint; dispid 7;

    function Ping(TIMEOUT: Integer): Smallint; dispid 8;

    function PrintScreen(PositionX: Smallint; PositionY: Smallint; const Message: WideString; 

                         TIMEOUT: Integer): Smallint; dispid 9;

    function ReadFromKeyBoard(InputTime: Integer; const Prompt: WideString; var Rep: WideString; 

                              TIMEOUT: Integer): Smallint; dispid 10;

    function Reboot(TIMEOUT: Integer): Smallint; dispid 11;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant); dispid 12;

    procedure SetParam(const ParamName: WideString; Value: OleVariant); dispid 13;

    function Enrol(const IRec: IMARecord; DBID: Smallint; EnrolType: Integer; NBFinger: Smallint; 

                   SaveRec: Integer; ExportPK: Smallint; var EnrolStatus: Smallint; 

                   var UserDBIndex: Integer; TIMEOUT: Integer; ConnectionTimeOut: Integer): Smallint; dispid 14;

    function CreateDB(const DataBase: IMADB; TIMEOUT: Integer): Smallint; dispid 15;

    function EraseDB(const DataBase: IMADB; TIMEOUT: Integer): Smallint; dispid 16;

    function DownloadDB(const DataBase: IMADB; NbRetry: Smallint; var Stop: Integer; 

                        TIMEOUT: Integer): Smallint; dispid 17;

    function AddRecord(const DataBase: IMADB; const Record_: IMARecord; var Status: Smallint; 

                       var UserIndex: Integer; TIMEOUT: Integer): Smallint; dispid 18;

    function RemoveRecord(const DataBase: IMADB; const Record_: IMARecord; TIMEOUT: Integer): Smallint; dispid 19;

    function RetrieveMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer; WiegandOrDC: Integer): Smallint; dispid 20;

    function SendMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer): Smallint; dispid 21;

    function RetrieveLogConfig(DBID: Smallint; const LogConfig: IMALogReport; TIMEOUT: Integer; 

                               NbRetry: Smallint): Smallint; dispid 22;

    function RetrieveLogs(DBID: Smallint; const Logs: IMALogs; TIMEOUT: Integer; NbRetry: Smallint): Smallint; dispid 23;

    function RetrieveAllDBReports(TabDBReport: {??PSafeArray}OleVariant; var NbBase: Smallint; 

                                  TIMEOUT: Integer): Smallint; dispid 24;

    function EraseLogs(DBID: Smallint; TIMEOUT: Integer): Smallint; dispid 25;

    function RetrieveMADBReport(DBID: Smallint; const Ireport: IMADBReport; TIMEOUT: Integer): Smallint; dispid 26;

    function OpenDistantSession(TIMEOUT: Integer): Smallint; dispid 27;

    function CloseDistantSession(TIMEOUT: Integer): Smallint; dispid 28;

    function SetContactlessKey(TIMEOUT: Integer; KeyNumber: Smallint; SectorNum: Smallint; 

                               KeySector: OleVariant): Smallint; dispid 29;

    function RetrieveKeyVersion(KeyNumber: Smallint; KeyStatus: Smallint; TIMEOUT: Integer; 

                                var response: Smallint; var KeyVersion: Smallint; 

                                var OperationDate: WideString; var KeyPeriod: Smallint): Smallint; dispid 30;

    function EraseAllKeys(TIMEOUT: Integer; var response: Smallint): Smallint; dispid 31;

    function EraseKey(KeyNumber: Smallint; KeyVersion: Smallint; TIMEOUT: Integer; 

                      var response: Smallint): Smallint; dispid 32;

    function SetRegistryKey(const KeyName: WideString; const KeyValue: WideString; TIMEOUT: Integer): Smallint; dispid 33;

    function RetrieveRegistryKey(const KeyName: WideString; var KeyValue: OleVariant; 

                                 TIMEOUT: Integer): Smallint; dispid 34;

    function UpdateMASoftware(const SoftPath: WideString; TIMEOUT: Integer): Smallint; dispid 35;

    function SendExtendedCommand(const ExtCmd: WideString; TIMEOUT: Integer): Smallint; dispid 36;

    function FindUser(DBID: Smallint; FieldIndex: Integer; RecOffset: Integer; 

                      UserData: OleVariant; var RecIndex: Integer; TIMEOUT: Integer): Smallint; dispid 37;

    function GetData(DBID: Smallint; FieldIndex: Integer; UserId: OleVariant; 

                     var ReturnData: OleVariant; TIMEOUT: Integer): Smallint; dispid 38;

    function GetPublicField(DBID: Smallint; FieldIndex: Integer; 

                            ReturnData: {??PSafeArray}OleVariant; TIMEOUT: Integer): Smallint; dispid 39;

    function UpdatePublicData(BDID: Smallint; ListOfField: {??PSafeArray}OleVariant; 

                              TIMEOUT: Integer): Smallint; dispid 40;

    function ChangePwd(PwdID: Smallint; const OldPwd: WideString; const NewPwd: WideString; 

                       TIMEOUT: Integer): Smallint; dispid 41;

    function RetrieveRegistryFile(const RegPath: WideString; TIMEOUT: Integer): Smallint; dispid 42;

    function RetrieveVersionEtendue(TIMEOUT: Integer): Smallint; dispid 43;

    function DisplayScreen(imageId: Smallint; attrib_1: Smallint; const line_1: WideString; 

                           attrib_2: Smallint; const line_2: WideString; attrib_3: Smallint; 

                           const line_3: WideString; i_TimeOut: Integer): Smallint; dispid 44;

    function SetTerminalKey(const maKey: WideString; TIMEOUT: Integer): Smallint; dispid 45;

    function ReadInput(var o_inputContent: OleVariant; cmdId: Smallint; maxInputChar: Smallint; 

                       imageId: Smallint; attrib_1: Smallint; line_1: OleVariant; lineId: Smallint; 

                       TIMEOUT: Integer): Smallint; dispid 46;

    function DataSend(line_1: OleVariant; TIMEOUT: Integer): Smallint; dispid 47;

    function EraseLanguageFile(line_1: OleVariant; listIndex: Integer; TIMEOUT: Integer): Smallint; dispid 48;

    function LoadLanguageFile(FileName: OleVariant; NbRetry: SYSINT; TIMEOUT: Integer): Smallint; dispid 49;

    function AddSeveralRecords(const DataBase: IMADB; NbRetry: Smallint; var Stop: Integer; 

                               TIMEOUT: Integer): Smallint; dispid 50;

    function setComMode(i_e_comMode: SYSINT): SYSINT; dispid 51;

    function getComMode: SYSINT; dispid 52;

    function initSSL(const i_bstr_passphrase: WideString): SYSINT; dispid 56;

    function executeRequestFile(const i_cs_REQfilename: WideString; 

                                const i_cs_REPfilename: WideString; i_i_timeout: SYSINT): SYSINT; dispid 57;

    function cmdDir(const i_pc_diskName: WideString; var o_pv_data: OleVariant; 

                    var o_pi_length: SYSINT): SYSINT; dispid 53;

    function SetMultipleRegistryKey(i_i_numberOfKeys: SYSINT; i_px_keys: {??PSafeArray}OleVariant; 

                                    i_i_timeout: SYSINT): SYSINT; dispid 54;

    function SetMIFAREKey(TIMEOUT: Integer; KeyNumber: Smallint; SectorNum: Smallint; 

                          KeySector: OleVariant): Smallint; dispid 55;

    function SendCustomCommand(const i_cs_RequestString: WideString; 

                               var o_cs_ReplyString: WideString; var i_replyLength: LongWord; 

                               i_i_timeout: Integer): Smallint; dispid 58;

    procedure SpecialRequest(i_i_RequestType: SYSINT; var i_pv_DataIn: OleVariant; 

                             i_i_DataInLength: SYSINT; var o_pv_DataOut: OleVariant; 

                             var i_pi_DataOutLength: SYSINT); dispid 59;

    procedure GetLicenseStatus(var o_hLicenseStatus: SYSINT); dispid 60;

  end;
 

// *********************************************************************//

// The Class CoMADB provides a Create and CreateRemote method to          

// create instances of the default interface IMADB exposed by              

// the CoClass MADB. The functions are intended to be used by             

// clients wishing to automate the CoClass objects exposed by the         

// server of this typelibrary.                                            

// *********************************************************************//

  CoMADB = class

    class function Create: IMADB;

    class function CreateRemote(const MachineName: string): IMADB;

  end;
 
 

// *********************************************************************//

// OLE Server Proxy class declaration

// Server Object    : TMADB

// Help String      : MADB Class

// Default Interface: IMADB

// Def. Intf. DISP? : No

// Event   Interface: 

// TypeFlags        : (2) CanCreate

// *********************************************************************//

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  TMADBProperties= class;

{$ENDIF}

  TMADB = class(TOleServer)

  private

    FIntf: IMADB;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    FProps: TMADBProperties;

    function GetServerProperties: TMADBProperties;

{$ENDIF}

    function GetDefaultInterface: IMADB;

  protected

    procedure InitServerData; override;

  public

    constructor Create(AOwner: TComponent); override;

    destructor  Destroy; override;

    procedure Connect; override;

    procedure ConnectTo(svrIntf: IMADB);

    procedure Disconnect; override;

    procedure AddField(const FieldName: WideString; FieldSize: Smallint; Private_: Integer);

    procedure Create1;

    procedure Reset;

    procedure Save;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant);

    procedure AddRecord(const PersonRec: IMARecord);

    procedure GetDataBaseField(FieldIndex: Smallint; var FieldName: WideString; 

                               var FieldSize: Smallint);

    procedure SetAllParam(DBID: Smallint; NBFinger: Smallint; MAType: Smallint; 

                          NBPersonInBase: SYSINT; MAVersion: SYSINT);

    procedure SaveToFile(const MBBioPath: WideString);

    procedure SaveToFileAndMA(const MBBioPath: WideString);

    procedure GetMADB(o_MADB: LongWord);

    property DefaultInterface: IMADB read GetDefaultInterface;

  published

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    property Server: TMADBProperties read GetServerProperties;

{$ENDIF}

  end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

// *********************************************************************//

// OLE Server Properties Proxy Class

// Server Object    : TMADB

// (This object is used by the IDE's Property Inspector to allow editing

//  of the properties of this server)

// *********************************************************************//

 TMADBProperties = class(TPersistent)

  private

    FServer:    TMADB;

    function    GetDefaultInterface: IMADB;

    constructor Create(AServer: TMADB);

  protected

  public

    property DefaultInterface: IMADB read GetDefaultInterface;

  published

  end;

{$ENDIF}
 
 

// *********************************************************************//

// The Class CoMADBReport provides a Create and CreateRemote method to          

// create instances of the default interface IMADBReport exposed by              

// the CoClass MADBReport. The functions are intended to be used by             

// clients wishing to automate the CoClass objects exposed by the         

// server of this typelibrary.                                            

// *********************************************************************//

  CoMADBReport = class

    class function Create: IMADBReport;

    class function CreateRemote(const MachineName: string): IMADBReport;

  end;
 
 

// *********************************************************************//

// OLE Server Proxy class declaration

// Server Object    : TMADBReport

// Help String      : MADBReport Class

// Default Interface: IMADBReport

// Def. Intf. DISP? : No

// Event   Interface: 

// TypeFlags        : (2) CanCreate

// *********************************************************************//

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  TMADBReportProperties= class;

{$ENDIF}

  TMADBReport = class(TOleServer)

  private

    FIntf: IMADBReport;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    FProps: TMADBReportProperties;

    function GetServerProperties: TMADBReportProperties;

{$ENDIF}

    function GetDefaultInterface: IMADBReport;

  protected

    procedure InitServerData; override;

  public

    constructor Create(AOwner: TComponent); override;

    destructor  Destroy; override;

    procedure Connect; override;

    procedure ConnectTo(svrIntf: IMADBReport);

    procedure Disconnect; override;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant);

    procedure SetParam(const ParamName: WideString; Value: OleVariant);

    property DefaultInterface: IMADBReport read GetDefaultInterface;

  published

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    property Server: TMADBReportProperties read GetServerProperties;

{$ENDIF}

  end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

// *********************************************************************//

// OLE Server Properties Proxy Class

// Server Object    : TMADBReport

// (This object is used by the IDE's Property Inspector to allow editing

//  of the properties of this server)

// *********************************************************************//

 TMADBReportProperties = class(TPersistent)

  private

    FServer:    TMADBReport;

    function    GetDefaultInterface: IMADBReport;

    constructor Create(AServer: TMADBReport);

  protected

  public

    property DefaultInterface: IMADBReport read GetDefaultInterface;

  published

  end;

{$ENDIF}
 
 

// *********************************************************************//

// The Class CoMALogReport provides a Create and CreateRemote method to          

// create instances of the default interface IMALogReport exposed by              

// the CoClass MALogReport. The functions are intended to be used by             

// clients wishing to automate the CoClass objects exposed by the         

// server of this typelibrary.                                            

// *********************************************************************//

  CoMALogReport = class

    class function Create: IMALogReport;

    class function CreateRemote(const MachineName: string): IMALogReport;

  end;
 
 

// *********************************************************************//

// OLE Server Proxy class declaration

// Server Object    : TMALogReport

// Help String      : MALogReport Class

// Default Interface: IMALogReport

// Def. Intf. DISP? : No

// Event   Interface: 

// TypeFlags        : (2) CanCreate

// *********************************************************************//

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  TMALogReportProperties= class;

{$ENDIF}

  TMALogReport = class(TOleServer)

  private

    FIntf: IMALogReport;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    FProps: TMALogReportProperties;

    function GetServerProperties: TMALogReportProperties;

{$ENDIF}

    function GetDefaultInterface: IMALogReport;

  protected

    procedure InitServerData; override;

  public

    constructor Create(AOwner: TComponent); override;

    destructor  Destroy; override;

    procedure Connect; override;

    procedure ConnectTo(svrIntf: IMALogReport);

    procedure Disconnect; override;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant);

    procedure SetParam(const UserParamName: WideString; Value: OleVariant);

    property DefaultInterface: IMALogReport read GetDefaultInterface;

  published

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    property Server: TMALogReportProperties read GetServerProperties;

{$ENDIF}

  end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

// *********************************************************************//

// OLE Server Properties Proxy Class

// Server Object    : TMALogReport

// (This object is used by the IDE's Property Inspector to allow editing

//  of the properties of this server)

// *********************************************************************//

 TMALogReportProperties = class(TPersistent)

  private

    FServer:    TMALogReport;

    function    GetDefaultInterface: IMALogReport;

    constructor Create(AServer: TMALogReport);

  protected

  public

    property DefaultInterface: IMALogReport read GetDefaultInterface;

  published

  end;

{$ENDIF}
 
 

// *********************************************************************//

// The Class CoMALogs provides a Create and CreateRemote method to          

// create instances of the default interface IMALogs exposed by              

// the CoClass MALogs. The functions are intended to be used by             

// clients wishing to automate the CoClass objects exposed by the         

// server of this typelibrary.                                            

// *********************************************************************//

  CoMALogs = class

    class function Create: IMALogs;

    class function CreateRemote(const MachineName: string): IMALogs;

  end;
 
 

// *********************************************************************//

// OLE Server Proxy class declaration

// Server Object    : TMALogs

// Help String      : MALogs Class

// Default Interface: IMALogs

// Def. Intf. DISP? : No

// Event   Interface: 

// TypeFlags        : (2) CanCreate

// *********************************************************************//

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  TMALogsProperties= class;

{$ENDIF}

  TMALogs = class(TOleServer)

  private

    FIntf: IMALogs;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    FProps: TMALogsProperties;

    function GetServerProperties: TMALogsProperties;

{$ENDIF}

    function GetDefaultInterface: IMALogs;

  protected

    procedure InitServerData; override;

  public

    constructor Create(AOwner: TComponent); override;

    destructor  Destroy; override;

    procedure Connect; override;

    procedure ConnectTo(svrIntf: IMALogs);

    procedure Disconnect; override;

    procedure SaveBinaryLogs(const FileName: WideString; Concat: Integer);

    procedure SaveTextLogs(const FileName: WideString; Concat: Integer);

    procedure GetParam(const ParamName: WideString; var Value: OleVariant);

    procedure SetParam(const ParamName: WideString; Value: OleVariant);

    property DefaultInterface: IMALogs read GetDefaultInterface;

  published

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    property Server: TMALogsProperties read GetServerProperties;

{$ENDIF}

  end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

// *********************************************************************//

// OLE Server Properties Proxy Class

// Server Object    : TMALogs

// (This object is used by the IDE's Property Inspector to allow editing

//  of the properties of this server)

// *********************************************************************//

 TMALogsProperties = class(TPersistent)

  private

    FServer:    TMALogs;

    function    GetDefaultInterface: IMALogs;

    constructor Create(AServer: TMALogs);

  protected

  public

    property DefaultInterface: IMALogs read GetDefaultInterface;

  published

  end;

{$ENDIF}
 
 

// *********************************************************************//

// The Class CoMAOptions provides a Create and CreateRemote method to          

// create instances of the default interface IMAOptions exposed by              

// the CoClass MAOptions. The functions are intended to be used by             

// clients wishing to automate the CoClass objects exposed by the         

// server of this typelibrary.                                            

// *********************************************************************//

  CoMAOptions = class

    class function Create: IMAOptions;

    class function CreateRemote(const MachineName: string): IMAOptions;

  end;
 
 

// *********************************************************************//

// OLE Server Proxy class declaration

// Server Object    : TMAOptions

// Help String      : MAOptions Class

// Default Interface: IMAOptions

// Def. Intf. DISP? : No

// Event   Interface: 

// TypeFlags        : (2) CanCreate

// *********************************************************************//

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  TMAOptionsProperties= class;

{$ENDIF}

  TMAOptions = class(TOleServer)

  private

    FIntf: IMAOptions;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    FProps: TMAOptionsProperties;

    function GetServerProperties: TMAOptionsProperties;

{$ENDIF}

    function GetDefaultInterface: IMAOptions;

  protected

    procedure InitServerData; override;

  public

    constructor Create(AOwner: TComponent); override;

    destructor  Destroy; override;

    procedure Connect; override;

    procedure ConnectTo(svrIntf: IMAOptions);

    procedure Disconnect; override;

    procedure SetAppConf(HOSTCOM: Smallint; MODE: Smallint; LogFile: Integer; AdminIdent: Integer; 

                         TimeMask: Integer);

    procedure SetCntlCardConf(ReaderType: Smallint; B: Smallint; N: Smallint; C: Smallint; 

                              MODE: Smallint);

    procedure SetDateTimeConf(const DateTime: WideString);

    procedure SetGUIConf(ChangeLanguage: Integer; DisplayHour: Integer; WelcomeField1: Smallint; 

                         WelcomeField2: Smallint; IdleTime: Smallint);

    procedure SetLanguageConf(Language: Smallint);

    procedure SetNetWorkConf(const IpAdress: WideString; const Subnet: WideString; 

                             const Gateway: WideString);

    procedure SetRelayConf(MODE: Integer; TIMEOUT: Integer);

    procedure SetSerialLinkConf(IdPort: Smallint; speed: Smallint; databits: Smallint; 

                                stopbits: Smallint; parity: Smallint; flowcontrol: Smallint; 

                                send: Integer; format: Smallint);

    procedure SetWiDCConf(ID: Smallint; send: Integer);

    procedure SetWiDCOptionsConf(FacilityCode: Smallint; DataClockLevel: Smallint; LedIn: Integer; 

                                 LedOutCardPresent: Integer);

    procedure Reset;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant);

    procedure SetFFDConf(LogEvents: Smallint; SendID: Smallint; Delay: Integer; 

                         PresDetect: Smallint; WDCId: Smallint; SecureLevel: Smallint);

    property DefaultInterface: IMAOptions read GetDefaultInterface;

  published

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    property Server: TMAOptionsProperties read GetServerProperties;

{$ENDIF}

  end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

// *********************************************************************//

// OLE Server Properties Proxy Class

// Server Object    : TMAOptions

// (This object is used by the IDE's Property Inspector to allow editing

//  of the properties of this server)

// *********************************************************************//

 TMAOptionsProperties = class(TPersistent)

  private

    FServer:    TMAOptions;

    function    GetDefaultInterface: IMAOptions;

    constructor Create(AServer: TMAOptions);

  protected

  public

    property DefaultInterface: IMAOptions read GetDefaultInterface;

  published

  end;

{$ENDIF}
 
 

// *********************************************************************//

// The Class CoMARecord provides a Create and CreateRemote method to          

// create instances of the default interface IMARecord exposed by              

// the CoClass MARecord. The functions are intended to be used by             

// clients wishing to automate the CoClass objects exposed by the         

// server of this typelibrary.                                            

// *********************************************************************//

  CoMARecord = class

    class function Create: IMARecord;

    class function CreateRemote(const MachineName: string): IMARecord;

  end;
 
 

// *********************************************************************//

// OLE Server Proxy class declaration

// Server Object    : TMARecord

// Help String      : MARecord Class

// Default Interface: IMARecord

// Def. Intf. DISP? : No

// Event   Interface: 

// TypeFlags        : (2) CanCreate

// *********************************************************************//

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  TMARecordProperties= class;

{$ENDIF}

  TMARecord = class(TOleServer)

  private

    FIntf: IMARecord;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    FProps: TMARecordProperties;

    function GetServerProperties: TMARecordProperties;

{$ENDIF}

    function GetDefaultInterface: IMARecord;

  protected

    procedure InitServerData; override;

  public

    constructor Create(AOwner: TComponent); override;

    destructor  Destroy; override;

    procedure Connect; override;

    procedure ConnectTo(svrIntf: IMARecord);

    procedure Disconnect; override;

    procedure AddFinger(PK: OleVariant; Position: Smallint);

    procedure RemoveFinger(Position: Smallint);

    procedure AddUserData(const FieldName: WideString; Data: OleVariant);

    procedure GetParam(const ParamName: WideString; var Value: OleVariant);

    procedure SetParam(const ParamName: WideString; Value: OleVariant);

    procedure GetUserData(DataIndex: Smallint; var FieldName: WideString; var Value: OleVariant);

    procedure Clean;

    property DefaultInterface: IMARecord read GetDefaultInterface;

  published

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    property Server: TMARecordProperties read GetServerProperties;

{$ENDIF}

  end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

// *********************************************************************//

// OLE Server Properties Proxy Class

// Server Object    : TMARecord

// (This object is used by the IDE's Property Inspector to allow editing

//  of the properties of this server)

// *********************************************************************//

 TMARecordProperties = class(TPersistent)

  private

    FServer:    TMARecord;

    function    GetDefaultInterface: IMARecord;

    constructor Create(AServer: TMARecord);

  protected

  public

    property DefaultInterface: IMARecord read GetDefaultInterface;

  published

  end;

{$ENDIF}
 
 

// *********************************************************************//

// The Class CoMATerminal provides a Create and CreateRemote method to          

// create instances of the default interface IMATerminal exposed by              

// the CoClass MATerminal. The functions are intended to be used by             

// clients wishing to automate the CoClass objects exposed by the         

// server of this typelibrary.                                            

// *********************************************************************//

  CoMATerminal = class

    class function Create: IMATerminal;

    class function CreateRemote(const MachineName: string): IMATerminal;

  end;
 
 

// *********************************************************************//

// OLE Server Proxy class declaration

// Server Object    : TMATerminal

// Help String      : MATerminal Class

// Default Interface: IMATerminal

// Def. Intf. DISP? : No

// Event   Interface: 

// TypeFlags        : (2) CanCreate

// *********************************************************************//

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  TMATerminalProperties= class;

{$ENDIF}

  TMATerminal = class(TOleServer)

  private

    FIntf: IMATerminal;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    FProps: TMATerminalProperties;

    function GetServerProperties: TMATerminalProperties;

{$ENDIF}

    function GetDefaultInterface: IMATerminal;

  protected

    procedure InitServerData; override;

  public

    constructor Create(AOwner: TComponent); override;

    destructor  Destroy; override;

    procedure Connect; override;

    procedure ConnectTo(svrIntf: IMATerminal);

    procedure Disconnect; override;

    function AccessOK(TIMEOUT: Integer; GreenLigth: Integer): Smallint;

    function Authenticate(const IRec: IMARecord; MatchThreshold: Smallint; qualThreshold: Smallint;

                          var iResult: Smallint; TIMEOUT: Integer; ConnectionTimeOut: Integer;

                          AuthentTimeOut: Integer): Smallint;

    function DefaultInit(TIMEOUT: Integer; KeepSettings: Integer): Smallint;

    function EraseAllDBs(TIMEOUT: Integer): Smallint;

    function GarbageCollector(TIMEOUT: Integer; DBID: Smallint): Smallint;

    function RetrieveVersion(TIMEOUT: Integer): Smallint;

    function Identify(DBID: Smallint; MatchThreshold: Smallint; TIMEOUT: Integer;

                      var iResult: Smallint; var UserIndex: Integer; var UserId: WideString; 

                      ConnectionTimeOut: Integer): Smallint;

    function Ping(TIMEOUT: Integer): Smallint;

    function PrintScreen(PositionX: Smallint; PositionY: Smallint; const Message: WideString; 

                         TIMEOUT: Integer): Smallint;

    function ReadFromKeyBoard(InputTime: Integer; const Prompt: WideString; var Rep: WideString; 

                              TIMEOUT: Integer): Smallint;

    function Reboot(TIMEOUT: Integer): Smallint;

    procedure GetParam(const ParamName: WideString; var Value: OleVariant);

    procedure SetParam(const ParamName: WideString; Value: OleVariant);

    function Enrol(const IRec: IMARecord; DBID: Smallint; EnrolType: Integer; NBFinger: Smallint; 

                   SaveRec: Integer; ExportPK: Smallint; var EnrolStatus: Smallint; 

                   var UserDBIndex: Integer; TIMEOUT: Integer; ConnectionTimeOut: Integer): Smallint;

    function CreateDB(const DataBase: IMADB; TIMEOUT: Integer): Smallint;

    function EraseDB(const DataBase: IMADB; TIMEOUT: Integer): Smallint;

    function DownloadDB(const DataBase: IMADB; NbRetry: Smallint; var Stop: Integer; 

                        TIMEOUT: Integer): Smallint;

    function AddRecord(const DataBase: IMADB; const Record_: IMARecord; var Status: Smallint; 

                       var UserIndex: Integer; TIMEOUT: Integer): Smallint;

    function RemoveRecord(const DataBase: IMADB; const Record_: IMARecord; TIMEOUT: Integer): Smallint;

    function RetrieveMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer; WiegandOrDC: Integer): Smallint;

    function SendMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer): Smallint;

    function RetrieveLogConfig(DBID: Smallint; const LogConfig: IMALogReport; TIMEOUT: Integer; 

                               NbRetry: Smallint): Smallint;

    function RetrieveLogs(DBID: Smallint; const Logs: IMALogs; TIMEOUT: Integer; NbRetry: Smallint): Smallint;

    function RetrieveAllDBReports(TabDBReport: PSafeArray; var NbBase: Smallint; TIMEOUT: Integer): Smallint;

    function EraseLogs(DBID: Smallint; TIMEOUT: Integer): Smallint;

    function RetrieveMADBReport(DBID: Smallint; const Ireport: IMADBReport; TIMEOUT: Integer): Smallint;

    function OpenDistantSession(TIMEOUT: Integer): Smallint;

    function CloseDistantSession(TIMEOUT: Integer): Smallint;

    function SetContactlessKey(TIMEOUT: Integer; KeyNumber: Smallint; SectorNum: Smallint; 

                               KeySector: OleVariant): Smallint;

    function RetrieveKeyVersion(KeyNumber: Smallint; KeyStatus: Smallint; TIMEOUT: Integer; 

                                var response: Smallint; var KeyVersion: Smallint; 

                                var OperationDate: WideString; var KeyPeriod: Smallint): Smallint;

    function EraseAllKeys(TIMEOUT: Integer; var response: Smallint): Smallint;

    function EraseKey(KeyNumber: Smallint; KeyVersion: Smallint; TIMEOUT: Integer; 

                      var response: Smallint): Smallint;

    function SetRegistryKey(const KeyName: WideString; const KeyValue: WideString; TIMEOUT: Integer): Smallint;

    function RetrieveRegistryKey(const KeyName: WideString; var KeyValue: OleVariant; 

                                 TIMEOUT: Integer): Smallint;

    function UpdateMASoftware(const SoftPath: WideString; TIMEOUT: Integer): Smallint;

    function SendExtendedCommand(const ExtCmd: WideString; TIMEOUT: Integer): Smallint;

    function FindUser(DBID: Smallint; FieldIndex: Integer; RecOffset: Integer; 

                      UserData: OleVariant; var RecIndex: Integer; TIMEOUT: Integer): Smallint;

    function GetData(DBID: Smallint; FieldIndex: Integer; UserId: OleVariant; 

                     var ReturnData: OleVariant; TIMEOUT: Integer): Smallint;

    function GetPublicField(DBID: Smallint; FieldIndex: Integer; ReturnData: PSafeArray; 

                            TIMEOUT: Integer): Smallint;

    function UpdatePublicData(BDID: Smallint; ListOfField: PSafeArray; TIMEOUT: Integer): Smallint;

    function ChangePwd(PwdID: Smallint; const OldPwd: WideString; const NewPwd: WideString; 

                       TIMEOUT: Integer): Smallint;

    function RetrieveRegistryFile(const RegPath: WideString; TIMEOUT: Integer): Smallint;

    function RetrieveVersionEtendue(TIMEOUT: Integer): Smallint;

    function DisplayScreen(imageId: Smallint; attrib_1: Smallint; const line_1: WideString; 

                           attrib_2: Smallint; const line_2: WideString; attrib_3: Smallint; 

                           const line_3: WideString; i_TimeOut: Integer): Smallint;

    function SetTerminalKey(const maKey: WideString; TIMEOUT: Integer): Smallint;

    function ReadInput(var o_inputContent: OleVariant; cmdId: Smallint; maxInputChar: Smallint; 

                       imageId: Smallint; attrib_1: Smallint; line_1: OleVariant; lineId: Smallint; 

                       TIMEOUT: Integer): Smallint;

    function DataSend(line_1: OleVariant; TIMEOUT: Integer): Smallint;

    function EraseLanguageFile(line_1: OleVariant; listIndex: Integer; TIMEOUT: Integer): Smallint;

    function LoadLanguageFile(FileName: OleVariant; NbRetry: SYSINT; TIMEOUT: Integer): Smallint;

    function AddSeveralRecords(const DataBase: IMADB; NbRetry: Smallint; var Stop: Integer; 

                               TIMEOUT: Integer): Smallint;

    function setComMode(i_e_comMode: SYSINT): SYSINT;

    function getComMode: SYSINT;

    function initSSL(const i_bstr_passphrase: WideString): SYSINT;

    function executeRequestFile(const i_cs_REQfilename: WideString; 

                                const i_cs_REPfilename: WideString; i_i_timeout: SYSINT): SYSINT;

    function cmdDir(const i_pc_diskName: WideString; var o_pv_data: OleVariant; 

                    var o_pi_length: SYSINT): SYSINT;

    function SetMultipleRegistryKey(i_i_numberOfKeys: SYSINT; i_px_keys: PSafeArray; 

                                    i_i_timeout: SYSINT): SYSINT;

    function SetMIFAREKey(TIMEOUT: Integer; KeyNumber: Smallint; SectorNum: Smallint; 

                          KeySector: OleVariant): Smallint;

    function SendCustomCommand(const i_cs_RequestString: WideString; 

                               var o_cs_ReplyString: WideString; var i_replyLength: LongWord; 

                               i_i_timeout: Integer): Smallint;

    procedure SpecialRequest(i_i_RequestType: SYSINT; var i_pv_DataIn: OleVariant; 

                             i_i_DataInLength: SYSINT; var o_pv_DataOut: OleVariant; 

                             var i_pi_DataOutLength: SYSINT);

    procedure GetLicenseStatus(var o_hLicenseStatus: SYSINT);

    property DefaultInterface: IMATerminal read GetDefaultInterface;

  published

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

    property Server: TMATerminalProperties read GetServerProperties;

{$ENDIF}

  end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

// *********************************************************************//

// OLE Server Properties Proxy Class

// Server Object    : TMATerminal

// (This object is used by the IDE's Property Inspector to allow editing

//  of the properties of this server)

// *********************************************************************//

 TMATerminalProperties = class(TPersistent)

  private

    FServer:    TMATerminal;

    function    GetDefaultInterface: IMATerminal;

    constructor Create(AServer: TMATerminal);

  protected

  public

    property DefaultInterface: IMATerminal read GetDefaultInterface;

  published

  end;

{$ENDIF}
 
 

procedure Register;
 

resourcestring

  dtlServerPage = 'ActiveX';
 

  dtlOcxPage = 'ActiveX';
 

implementation
 

uses ComObj;
 

class function CoMADB.Create: IMADB;

begin

  Result := CreateComObject(CLASS_MADB) as IMADB;

end;
 

class function CoMADB.CreateRemote(const MachineName: string): IMADB;

begin

  Result := CreateRemoteComObject(MachineName, CLASS_MADB) as IMADB;

end;
 

procedure TMADB.InitServerData;

const

  CServerData: TServerData = (

    ClassID:   '{2E9D2D26-C23F-41DA-BB63-E3E24CB09452}';

    IntfIID:   '{09EC1A0D-110F-43F0-B239-D381239BF3EC}';

    EventIID:  '';

    LicenseKey: nil;

    Version: 500);

begin

  ServerData := @CServerData;

end;
 

procedure TMADB.Connect;

var

  punk: IUnknown;

begin

  if FIntf = nil then

  begin

    punk := GetServer;

    Fintf:= punk as IMADB;

  end;

end;
 

procedure TMADB.ConnectTo(svrIntf: IMADB);

begin

  Disconnect;

  FIntf := svrIntf;

end;
 

procedure TMADB.DisConnect;

begin

  if Fintf <> nil then

  begin

    FIntf := nil;

  end;

end;
 

function TMADB.GetDefaultInterface: IMADB;

begin

  if FIntf = nil then

    Connect;

  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');

  Result := FIntf;

end;
 

constructor TMADB.Create(AOwner: TComponent);

begin

  inherited Create(AOwner);

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps := TMADBProperties.Create(Self);

{$ENDIF}

end;
 

destructor TMADB.Destroy;

begin

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps.Free;

{$ENDIF}

  inherited Destroy;

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

function TMADB.GetServerProperties: TMADBProperties;

begin

  Result := FProps;

end;

{$ENDIF}
 

procedure TMADB.AddField(const FieldName: WideString; FieldSize: Smallint; Private_: Integer);

begin

  DefaultInterface.AddField(FieldName, FieldSize, Private_);

end;
 

procedure TMADB.Create1;

begin

  DefaultInterface.Create;

end;
 

procedure TMADB.Reset;

begin

  DefaultInterface.Reset;

end;
 

procedure TMADB.Save;

begin

  DefaultInterface.Save;

end;
 

procedure TMADB.GetParam(const ParamName: WideString; var Value: OleVariant);

begin

  DefaultInterface.GetParam(ParamName, Value);

end;
 

procedure TMADB.AddRecord(const PersonRec: IMARecord);

begin

  DefaultInterface.AddRecord(PersonRec);

end;
 

procedure TMADB.GetDataBaseField(FieldIndex: Smallint; var FieldName: WideString; 

                                 var FieldSize: Smallint);

begin

  DefaultInterface.GetDataBaseField(FieldIndex, FieldName, FieldSize);

end;
 

procedure TMADB.SetAllParam(DBID: Smallint; NBFinger: Smallint; MAType: Smallint; 

                            NBPersonInBase: SYSINT; MAVersion: SYSINT);

begin

  DefaultInterface.SetAllParam(DBID, NBFinger, MAType, NBPersonInBase, MAVersion);

end;
 

procedure TMADB.SaveToFile(const MBBioPath: WideString);

begin

  DefaultInterface.SaveToFile(MBBioPath);

end;
 

procedure TMADB.SaveToFileAndMA(const MBBioPath: WideString);

begin

  DefaultInterface.SaveToFileAndMA(MBBioPath);

end;
 

procedure TMADB.GetMADB(o_MADB: LongWord);

begin

  DefaultInterface.GetMADB(o_MADB);

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

constructor TMADBProperties.Create(AServer: TMADB);

begin

  inherited Create;

  FServer := AServer;

end;
 

function TMADBProperties.GetDefaultInterface: IMADB;

begin

  Result := FServer.DefaultInterface;

end;
 

{$ENDIF}
 

class function CoMADBReport.Create: IMADBReport;

begin

  Result := CreateComObject(CLASS_MADBReport) as IMADBReport;

end;
 

class function CoMADBReport.CreateRemote(const MachineName: string): IMADBReport;

begin

  Result := CreateRemoteComObject(MachineName, CLASS_MADBReport) as IMADBReport;

end;
 

procedure TMADBReport.InitServerData;

const

  CServerData: TServerData = (

    ClassID:   '{43EAB047-00AD-4756-AA04-9D47F4EE9E1C}';

    IntfIID:   '{E960E9B1-5CA8-4266-AFCD-4A508A461F5E}';

    EventIID:  '';

    LicenseKey: nil;

    Version: 500);

begin

  ServerData := @CServerData;

end;
 

procedure TMADBReport.Connect;

var

  punk: IUnknown;

begin

  if FIntf = nil then

  begin

    punk := GetServer;

    Fintf:= punk as IMADBReport;

  end;

end;
 

procedure TMADBReport.ConnectTo(svrIntf: IMADBReport);

begin

  Disconnect;

  FIntf := svrIntf;

end;
 

procedure TMADBReport.DisConnect;

begin

  if Fintf <> nil then

  begin

    FIntf := nil;

  end;

end;
 

function TMADBReport.GetDefaultInterface: IMADBReport;

begin

  if FIntf = nil then

    Connect;

  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');

  Result := FIntf;

end;
 

constructor TMADBReport.Create(AOwner: TComponent);

begin

  inherited Create(AOwner);

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps := TMADBReportProperties.Create(Self);

{$ENDIF}

end;
 

destructor TMADBReport.Destroy;

begin

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps.Free;

{$ENDIF}

  inherited Destroy;

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

function TMADBReport.GetServerProperties: TMADBReportProperties;

begin

  Result := FProps;

end;

{$ENDIF}
 

procedure TMADBReport.GetParam(const ParamName: WideString; var Value: OleVariant);

begin

  DefaultInterface.GetParam(ParamName, Value);

end;
 

procedure TMADBReport.SetParam(const ParamName: WideString; Value: OleVariant);

begin

  DefaultInterface.SetParam(ParamName, Value);

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

constructor TMADBReportProperties.Create(AServer: TMADBReport);

begin

  inherited Create;

  FServer := AServer;

end;
 

function TMADBReportProperties.GetDefaultInterface: IMADBReport;

begin

  Result := FServer.DefaultInterface;

end;
 

{$ENDIF}
 

class function CoMALogReport.Create: IMALogReport;

begin

  Result := CreateComObject(CLASS_MALogReport) as IMALogReport;

end;
 

class function CoMALogReport.CreateRemote(const MachineName: string): IMALogReport;

begin

  Result := CreateRemoteComObject(MachineName, CLASS_MALogReport) as IMALogReport;

end;
 

procedure TMALogReport.InitServerData;

const

  CServerData: TServerData = (

    ClassID:   '{483523F4-6F55-4342-9879-D319643555E4}';

    IntfIID:   '{BD2B4865-41B5-4F22-AEA3-25B492B66313}';

    EventIID:  '';

    LicenseKey: nil;

    Version: 500);

begin

  ServerData := @CServerData;

end;
 

procedure TMALogReport.Connect;

var

  punk: IUnknown;

begin

  if FIntf = nil then

  begin

    punk := GetServer;

    Fintf:= punk as IMALogReport;

  end;

end;
 

procedure TMALogReport.ConnectTo(svrIntf: IMALogReport);

begin

  Disconnect;

  FIntf := svrIntf;

end;
 

procedure TMALogReport.DisConnect;

begin

  if Fintf <> nil then

  begin

    FIntf := nil;

  end;

end;
 

function TMALogReport.GetDefaultInterface: IMALogReport;

begin

  if FIntf = nil then

    Connect;

  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');

  Result := FIntf;

end;
 

constructor TMALogReport.Create(AOwner: TComponent);

begin

  inherited Create(AOwner);

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps := TMALogReportProperties.Create(Self);

{$ENDIF}

end;
 

destructor TMALogReport.Destroy;

begin

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps.Free;

{$ENDIF}

  inherited Destroy;

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

function TMALogReport.GetServerProperties: TMALogReportProperties;

begin

  Result := FProps;

end;

{$ENDIF}
 

procedure TMALogReport.GetParam(const ParamName: WideString; var Value: OleVariant);

begin

  DefaultInterface.GetParam(ParamName, Value);

end;
 

procedure TMALogReport.SetParam(const UserParamName: WideString; Value: OleVariant);

begin

  DefaultInterface.SetParam(UserParamName, Value);

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

constructor TMALogReportProperties.Create(AServer: TMALogReport);

begin

  inherited Create;

  FServer := AServer;

end;
 

function TMALogReportProperties.GetDefaultInterface: IMALogReport;

begin

  Result := FServer.DefaultInterface;

end;
 

{$ENDIF}
 

class function CoMALogs.Create: IMALogs;

begin

  Result := CreateComObject(CLASS_MALogs) as IMALogs;

end;
 

class function CoMALogs.CreateRemote(const MachineName: string): IMALogs;

begin

  Result := CreateRemoteComObject(MachineName, CLASS_MALogs) as IMALogs;

end;
 

procedure TMALogs.InitServerData;

const

  CServerData: TServerData = (

    ClassID:   '{83D74537-6A08-4A5E-970C-DB2FA859F068}';

    IntfIID:   '{E5A8DA50-ED4A-4892-8183-4A2C31C12BCE}';

    EventIID:  '';

    LicenseKey: nil;

    Version: 500);

begin

  ServerData := @CServerData;

end;
 

procedure TMALogs.Connect;

var

  punk: IUnknown;

begin

  if FIntf = nil then

  begin

    punk := GetServer;

    Fintf:= punk as IMALogs;

  end;

end;
 

procedure TMALogs.ConnectTo(svrIntf: IMALogs);

begin

  Disconnect;

  FIntf := svrIntf;

end;
 

procedure TMALogs.DisConnect;

begin

  if Fintf <> nil then

  begin

    FIntf := nil;

  end;

end;
 

function TMALogs.GetDefaultInterface: IMALogs;

begin

  if FIntf = nil then

    Connect;

  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');

  Result := FIntf;

end;
 

constructor TMALogs.Create(AOwner: TComponent);

begin

  inherited Create(AOwner);

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps := TMALogsProperties.Create(Self);

{$ENDIF}

end;
 

destructor TMALogs.Destroy;

begin

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps.Free;

{$ENDIF}

  inherited Destroy;

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

function TMALogs.GetServerProperties: TMALogsProperties;

begin

  Result := FProps;

end;

{$ENDIF}
 

procedure TMALogs.SaveBinaryLogs(const FileName: WideString; Concat: Integer);

begin

  DefaultInterface.SaveBinaryLogs(FileName, Concat);

end;
 

procedure TMALogs.SaveTextLogs(const FileName: WideString; Concat: Integer);

begin

  DefaultInterface.SaveTextLogs(FileName, Concat);

end;
 

procedure TMALogs.GetParam(const ParamName: WideString; var Value: OleVariant);

begin

  DefaultInterface.GetParam(ParamName, Value);

end;
 

procedure TMALogs.SetParam(const ParamName: WideString; Value: OleVariant);

begin

  DefaultInterface.SetParam(ParamName, Value);

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

constructor TMALogsProperties.Create(AServer: TMALogs);

begin

  inherited Create;

  FServer := AServer;

end;
 

function TMALogsProperties.GetDefaultInterface: IMALogs;

begin

  Result := FServer.DefaultInterface;

end;
 

{$ENDIF}
 

class function CoMAOptions.Create: IMAOptions;

begin

  Result := CreateComObject(CLASS_MAOptions) as IMAOptions;

end;
 

class function CoMAOptions.CreateRemote(const MachineName: string): IMAOptions;

begin

  Result := CreateRemoteComObject(MachineName, CLASS_MAOptions) as IMAOptions;

end;
 

procedure TMAOptions.InitServerData;

const

  CServerData: TServerData = (

    ClassID:   '{AA8522E7-E4DF-4C8B-8FB3-595EBDD3F951}';

    IntfIID:   '{486F39E1-E6E8-4A6C-AC2C-2C936FA58A7E}';

    EventIID:  '';

    LicenseKey: nil;

    Version: 500);

begin

  ServerData := @CServerData;

end;
 

procedure TMAOptions.Connect;

var

  punk: IUnknown;

begin

  if FIntf = nil then

  begin

    punk := GetServer;

    Fintf:= punk as IMAOptions;

  end;

end;
 

procedure TMAOptions.ConnectTo(svrIntf: IMAOptions);

begin

  Disconnect;

  FIntf := svrIntf;

end;
 

procedure TMAOptions.DisConnect;

begin

  if Fintf <> nil then

  begin

    FIntf := nil;

  end;

end;
 

function TMAOptions.GetDefaultInterface: IMAOptions;

begin

  if FIntf = nil then

    Connect;

  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');

  Result := FIntf;

end;
 

constructor TMAOptions.Create(AOwner: TComponent);

begin

  inherited Create(AOwner);

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps := TMAOptionsProperties.Create(Self);

{$ENDIF}

end;
 

destructor TMAOptions.Destroy;

begin

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps.Free;

{$ENDIF}

  inherited Destroy;

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

function TMAOptions.GetServerProperties: TMAOptionsProperties;

begin

  Result := FProps;

end;

{$ENDIF}
 

procedure TMAOptions.SetAppConf(HOSTCOM: Smallint; MODE: Smallint; LogFile: Integer; 

                                AdminIdent: Integer; TimeMask: Integer);

begin

  DefaultInterface.SetAppConf(HOSTCOM, MODE, LogFile, AdminIdent, TimeMask);

end;
 

procedure TMAOptions.SetCntlCardConf(ReaderType: Smallint; B: Smallint; N: Smallint; C: Smallint; 

                                     MODE: Smallint);

begin

  DefaultInterface.SetCntlCardConf(ReaderType, B, N, C, MODE);

end;
 

procedure TMAOptions.SetDateTimeConf(const DateTime: WideString);

begin

  DefaultInterface.SetDateTimeConf(DateTime);

end;
 

procedure TMAOptions.SetGUIConf(ChangeLanguage: Integer; DisplayHour: Integer; 

                                WelcomeField1: Smallint; WelcomeField2: Smallint; IdleTime: Smallint);

begin

  DefaultInterface.SetGUIConf(ChangeLanguage, DisplayHour, WelcomeField1, WelcomeField2, IdleTime);

end;
 

procedure TMAOptions.SetLanguageConf(Language: Smallint);

begin

  DefaultInterface.SetLanguageConf(Language);

end;
 

procedure TMAOptions.SetNetWorkConf(const IpAdress: WideString; const Subnet: WideString; 

                                    const Gateway: WideString);

begin

  DefaultInterface.SetNetWorkConf(IpAdress, Subnet, Gateway);

end;
 

procedure TMAOptions.SetRelayConf(MODE: Integer; TIMEOUT: Integer);

begin

  DefaultInterface.SetRelayConf(MODE, TIMEOUT);

end;
 

procedure TMAOptions.SetSerialLinkConf(IdPort: Smallint; speed: Smallint; databits: Smallint; 

                                       stopbits: Smallint; parity: Smallint; flowcontrol: Smallint; 

                                       send: Integer; format: Smallint);

begin

  DefaultInterface.SetSerialLinkConf(IdPort, speed, databits, stopbits, parity, flowcontrol, send, 

                                     format);

end;
 

procedure TMAOptions.SetWiDCConf(ID: Smallint; send: Integer);

begin

  DefaultInterface.SetWiDCConf(ID, send);

end;
 

procedure TMAOptions.SetWiDCOptionsConf(FacilityCode: Smallint; DataClockLevel: Smallint; 

                                        LedIn: Integer; LedOutCardPresent: Integer);

begin

  DefaultInterface.SetWiDCOptionsConf(FacilityCode, DataClockLevel, LedIn, LedOutCardPresent);

end;
 

procedure TMAOptions.Reset;

begin

  DefaultInterface.Reset;

end;
 

procedure TMAOptions.GetParam(const ParamName: WideString; var Value: OleVariant);

begin

  DefaultInterface.GetParam(ParamName, Value);

end;
 

procedure TMAOptions.SetFFDConf(LogEvents: Smallint; SendID: Smallint; Delay: Integer; 

                                PresDetect: Smallint; WDCId: Smallint; SecureLevel: Smallint);

begin

  DefaultInterface.SetFFDConf(LogEvents, SendID, Delay, PresDetect, WDCId, SecureLevel);

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

constructor TMAOptionsProperties.Create(AServer: TMAOptions);

begin

  inherited Create;

  FServer := AServer;

end;
 

function TMAOptionsProperties.GetDefaultInterface: IMAOptions;

begin

  Result := FServer.DefaultInterface;

end;
 

{$ENDIF}
 

class function CoMARecord.Create: IMARecord;

begin

  Result := CreateComObject(CLASS_MARecord) as IMARecord;

end;
 

class function CoMARecord.CreateRemote(const MachineName: string): IMARecord;

begin

  Result := CreateRemoteComObject(MachineName, CLASS_MARecord) as IMARecord;

end;
 

procedure TMARecord.InitServerData;

const

  CServerData: TServerData = (

    ClassID:   '{BD7E3E65-7D36-45A5-B86E-2FA853A9A738}';

    IntfIID:   '{72888AD7-0605-496D-9F8C-E7D79A3F8CEA}';

    EventIID:  '';

    LicenseKey: nil;

    Version: 500);

begin

  ServerData := @CServerData;

end;
 

procedure TMARecord.Connect;

var

  punk: IUnknown;

begin

  if FIntf = nil then

  begin

    punk := GetServer;

    Fintf:= punk as IMARecord;

  end;

end;
 

procedure TMARecord.ConnectTo(svrIntf: IMARecord);

begin

  Disconnect;

  FIntf := svrIntf;

end;
 

procedure TMARecord.DisConnect;

begin

  if Fintf <> nil then

  begin

    FIntf := nil;

  end;

end;
 

function TMARecord.GetDefaultInterface: IMARecord;

begin

  if FIntf = nil then

    Connect;

  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');

  Result := FIntf;

end;
 

constructor TMARecord.Create(AOwner: TComponent);

begin

  inherited Create(AOwner);

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps := TMARecordProperties.Create(Self);

{$ENDIF}

end;
 

destructor TMARecord.Destroy;

begin

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps.Free;

{$ENDIF}

  inherited Destroy;

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

function TMARecord.GetServerProperties: TMARecordProperties;

begin

  Result := FProps;

end;

{$ENDIF}
 

procedure TMARecord.AddFinger(PK: OleVariant; Position: Smallint);

begin

  DefaultInterface.AddFinger(PK, Position);

end;
 

procedure TMARecord.RemoveFinger(Position: Smallint);

begin

  DefaultInterface.RemoveFinger(Position);

end;
 

procedure TMARecord.AddUserData(const FieldName: WideString; Data: OleVariant);

begin

  DefaultInterface.AddUserData(FieldName, Data);

end;
 

procedure TMARecord.GetParam(const ParamName: WideString; var Value: OleVariant);

begin

  DefaultInterface.GetParam(ParamName, Value);

end;
 

procedure TMARecord.SetParam(const ParamName: WideString; Value: OleVariant);

begin

  DefaultInterface.SetParam(ParamName, Value);

end;
 

procedure TMARecord.GetUserData(DataIndex: Smallint; var FieldName: WideString; 

                                var Value: OleVariant);

begin

  DefaultInterface.GetUserData(DataIndex, FieldName, Value);

end;
 

procedure TMARecord.Clean;

begin

  DefaultInterface.Clean;

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

constructor TMARecordProperties.Create(AServer: TMARecord);

begin

  inherited Create;

  FServer := AServer;

end;
 

function TMARecordProperties.GetDefaultInterface: IMARecord;

begin

  Result := FServer.DefaultInterface;

end;
 

{$ENDIF}
 

class function CoMATerminal.Create: IMATerminal;

begin

  Result := CreateComObject(CLASS_MATerminal) as IMATerminal;

end;
 

class function CoMATerminal.CreateRemote(const MachineName: string): IMATerminal;

begin

  Result := CreateRemoteComObject(MachineName, CLASS_MATerminal) as IMATerminal;

end;
 

procedure TMATerminal.InitServerData;

const

  CServerData: TServerData = (

    ClassID:   '{5960999D-2C1D-4781-8815-D1A363F0F5AA}';

    IntfIID:   '{D92A279C-46AA-4908-9F4D-8BE4F6D2256A}';

    EventIID:  '';

    LicenseKey: nil;

    Version: 500);

begin

  ServerData := @CServerData;

end;
 

procedure TMATerminal.Connect;

var

  punk: IUnknown;

begin

  if FIntf = nil then

  begin

    punk := GetServer;

    Fintf:= punk as IMATerminal;

  end;

end;
 

procedure TMATerminal.ConnectTo(svrIntf: IMATerminal);

begin

  Disconnect;

  FIntf := svrIntf;

end;
 

procedure TMATerminal.DisConnect;

begin

  if Fintf <> nil then

  begin

    FIntf := nil;

  end;

end;
 

function TMATerminal.GetDefaultInterface: IMATerminal;

begin

  if FIntf = nil then

    Connect;

  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');

  Result := FIntf;

end;
 

constructor TMATerminal.Create(AOwner: TComponent);

begin

  inherited Create(AOwner);

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps := TMATerminalProperties.Create(Self);

{$ENDIF}

end;
 

destructor TMATerminal.Destroy;

begin

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

  FProps.Free;

{$ENDIF}

  inherited Destroy;

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

function TMATerminal.GetServerProperties: TMATerminalProperties;

begin

  Result := FProps;

end;

{$ENDIF}
 

function TMATerminal.AccessOK(TIMEOUT: Integer; GreenLigth: Integer): Smallint;

begin

  Result := DefaultInterface.AccessOK(TIMEOUT, GreenLigth);

end;
 

function TMATerminal.Authenticate(const IRec: IMARecord; MatchThreshold: Smallint; 

                                  qualThreshold: Smallint; var iResult: Smallint; TIMEOUT: Integer;

                                  ConnectionTimeOut: Integer; AuthentTimeOut: Integer): Smallint;

begin

  Result := DefaultInterface.Authenticate(IRec, MatchThreshold, qualThreshold, iResult, TIMEOUT,

                                          ConnectionTimeOut, AuthentTimeOut);

end;
 

function TMATerminal.DefaultInit(TIMEOUT: Integer; KeepSettings: Integer): Smallint;

begin

  Result := DefaultInterface.DefaultInit(TIMEOUT, KeepSettings);

end;
 

function TMATerminal.EraseAllDBs(TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.EraseAllDBs(TIMEOUT);

end;
 

function TMATerminal.GarbageCollector(TIMEOUT: Integer; DBID: Smallint): Smallint;

begin

  Result := DefaultInterface.GarbageCollector(TIMEOUT, DBID);

end;
 

function TMATerminal.RetrieveVersion(TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.RetrieveVersion(TIMEOUT);

end;
 

function TMATerminal.Identify(DBID: Smallint; MatchThreshold: Smallint; TIMEOUT: Integer; 

                              var iResult: Smallint; var UserIndex: Integer; var UserId: WideString;

                              ConnectionTimeOut: Integer): Smallint;

begin

  Result := DefaultInterface.Identify(DBID, MatchThreshold, TIMEOUT, iResult, UserIndex, UserId,

                                      ConnectionTimeOut);

end;
 

function TMATerminal.Ping(TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.Ping(TIMEOUT);

end;
 

function TMATerminal.PrintScreen(PositionX: Smallint; PositionY: Smallint; 

                                 const Message: WideString; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.PrintScreen(PositionX, PositionY, Message, TIMEOUT);

end;
 

function TMATerminal.ReadFromKeyBoard(InputTime: Integer; const Prompt: WideString; 

                                      var Rep: WideString; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.ReadFromKeyBoard(InputTime, Prompt, Rep, TIMEOUT);

end;
 

function TMATerminal.Reboot(TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.Reboot(TIMEOUT);

end;
 

procedure TMATerminal.GetParam(const ParamName: WideString; var Value: OleVariant);

begin

  DefaultInterface.GetParam(ParamName, Value);

end;
 

procedure TMATerminal.SetParam(const ParamName: WideString; Value: OleVariant);

begin

  DefaultInterface.SetParam(ParamName, Value);

end;
 

function TMATerminal.Enrol(const IRec: IMARecord; DBID: Smallint; EnrolType: Integer; 

                           NBFinger: Smallint; SaveRec: Integer; ExportPK: Smallint; 

                           var EnrolStatus: Smallint; var UserDBIndex: Integer; TIMEOUT: Integer; 

                           ConnectionTimeOut: Integer): Smallint;

begin

  Result := DefaultInterface.Enrol(IRec, DBID, EnrolType, NBFinger, SaveRec, ExportPK, EnrolStatus, 

                                   UserDBIndex, TIMEOUT, ConnectionTimeOut);

end;
 

function TMATerminal.CreateDB(const DataBase: IMADB; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.CreateDB(DataBase, TIMEOUT);

end;
 

function TMATerminal.EraseDB(const DataBase: IMADB; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.EraseDB(DataBase, TIMEOUT);

end;
 

function TMATerminal.DownloadDB(const DataBase: IMADB; NbRetry: Smallint; var Stop: Integer; 

                                TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.DownloadDB(DataBase, NbRetry, Stop, TIMEOUT);

end;
 

function TMATerminal.AddRecord(const DataBase: IMADB; const Record_: IMARecord; 

                               var Status: Smallint; var UserIndex: Integer; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.AddRecord(DataBase, Record_, Status, UserIndex, TIMEOUT);

end;
 

function TMATerminal.RemoveRecord(const DataBase: IMADB; const Record_: IMARecord; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.RemoveRecord(DataBase, Record_, TIMEOUT);

end;
 

function TMATerminal.RetrieveMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer; 

                                      WiegandOrDC: Integer): Smallint;

begin

  Result := DefaultInterface.RetrieveMAConfig(MAOpt, TIMEOUT, WiegandOrDC);

end;
 

function TMATerminal.SendMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.SendMAConfig(MAOpt, TIMEOUT);

end;
 

function TMATerminal.RetrieveLogConfig(DBID: Smallint; const LogConfig: IMALogReport; 

                                       TIMEOUT: Integer; NbRetry: Smallint): Smallint;

begin

  Result := DefaultInterface.RetrieveLogConfig(DBID, LogConfig, TIMEOUT, NbRetry);

end;
 

function TMATerminal.RetrieveLogs(DBID: Smallint; const Logs: IMALogs; TIMEOUT: Integer; 

                                  NbRetry: Smallint): Smallint;

begin

  Result := DefaultInterface.RetrieveLogs(DBID, Logs, TIMEOUT, NbRetry);

end;
 

function TMATerminal.RetrieveAllDBReports(TabDBReport: PSafeArray; var NbBase: Smallint; 

                                          TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.RetrieveAllDBReports(TabDBReport, NbBase, TIMEOUT);

end;
 

function TMATerminal.EraseLogs(DBID: Smallint; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.EraseLogs(DBID, TIMEOUT);

end;
 

function TMATerminal.RetrieveMADBReport(DBID: Smallint; const Ireport: IMADBReport; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.RetrieveMADBReport(DBID, Ireport, TIMEOUT);

end;
 

function TMATerminal.OpenDistantSession(TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.OpenDistantSession(TIMEOUT);

end;
 

function TMATerminal.CloseDistantSession(TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.CloseDistantSession(TIMEOUT);

end;
 

function TMATerminal.SetContactlessKey(TIMEOUT: Integer; KeyNumber: Smallint; SectorNum: Smallint; 

                                       KeySector: OleVariant): Smallint;

begin

  Result := DefaultInterface.SetContactlessKey(TIMEOUT, KeyNumber, SectorNum, KeySector);

end;
 

function TMATerminal.RetrieveKeyVersion(KeyNumber: Smallint; KeyStatus: Smallint; TIMEOUT: Integer; 

                                        var response: Smallint; var KeyVersion: Smallint; 

                                        var OperationDate: WideString; var KeyPeriod: Smallint): Smallint;

begin

  Result := DefaultInterface.RetrieveKeyVersion(KeyNumber, KeyStatus, TIMEOUT, response, 

                                                KeyVersion, OperationDate, KeyPeriod);

end;
 

function TMATerminal.EraseAllKeys(TIMEOUT: Integer; var response: Smallint): Smallint;

begin

  Result := DefaultInterface.EraseAllKeys(TIMEOUT, response);

end;
 

function TMATerminal.EraseKey(KeyNumber: Smallint; KeyVersion: Smallint; TIMEOUT: Integer; 

                              var response: Smallint): Smallint;

begin

  Result := DefaultInterface.EraseKey(KeyNumber, KeyVersion, TIMEOUT, response);

end;
 

function TMATerminal.SetRegistryKey(const KeyName: WideString; const KeyValue: WideString; 

                                    TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.SetRegistryKey(KeyName, KeyValue, TIMEOUT);

end;
 

function TMATerminal.RetrieveRegistryKey(const KeyName: WideString; var KeyValue: OleVariant; 

                                         TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.RetrieveRegistryKey(KeyName, KeyValue, TIMEOUT);

end;
 

function TMATerminal.UpdateMASoftware(const SoftPath: WideString; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.UpdateMASoftware(SoftPath, TIMEOUT);

end;
 

function TMATerminal.SendExtendedCommand(const ExtCmd: WideString; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.SendExtendedCommand(ExtCmd, TIMEOUT);

end;
 

function TMATerminal.FindUser(DBID: Smallint; FieldIndex: Integer; RecOffset: Integer; 

                              UserData: OleVariant; var RecIndex: Integer; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.FindUser(DBID, FieldIndex, RecOffset, UserData, RecIndex, TIMEOUT);

end;
 

function TMATerminal.GetData(DBID: Smallint; FieldIndex: Integer; UserId: OleVariant; 

                             var ReturnData: OleVariant; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.GetData(DBID, FieldIndex, UserId, ReturnData, TIMEOUT);

end;
 

function TMATerminal.GetPublicField(DBID: Smallint; FieldIndex: Integer; ReturnData: PSafeArray; 

                                    TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.GetPublicField(DBID, FieldIndex, ReturnData, TIMEOUT);

end;
 

function TMATerminal.UpdatePublicData(BDID: Smallint; ListOfField: PSafeArray; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.UpdatePublicData(BDID, ListOfField, TIMEOUT);

end;
 

function TMATerminal.ChangePwd(PwdID: Smallint; const OldPwd: WideString; const NewPwd: WideString; 

                               TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.ChangePwd(PwdID, OldPwd, NewPwd, TIMEOUT);

end;
 

function TMATerminal.RetrieveRegistryFile(const RegPath: WideString; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.RetrieveRegistryFile(RegPath, TIMEOUT);

end;
 

function TMATerminal.RetrieveVersionEtendue(TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.RetrieveVersionEtendue(TIMEOUT);

end;
 

function TMATerminal.DisplayScreen(imageId: Smallint; attrib_1: Smallint; const line_1: WideString; 

                                   attrib_2: Smallint; const line_2: WideString; 

                                   attrib_3: Smallint; const line_3: WideString; i_TimeOut: Integer): Smallint;

begin

  Result := DefaultInterface.DisplayScreen(imageId, attrib_1, line_1, attrib_2, line_2, attrib_3, 

                                           line_3, i_TimeOut);

end;
 

function TMATerminal.SetTerminalKey(const maKey: WideString; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.SetTerminalKey(maKey, TIMEOUT);

end;
 

function TMATerminal.ReadInput(var o_inputContent: OleVariant; cmdId: Smallint; 

                               maxInputChar: Smallint; imageId: Smallint; attrib_1: Smallint; 

                               line_1: OleVariant; lineId: Smallint; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.ReadInput(o_inputContent, cmdId, maxInputChar, imageId, attrib_1, 

                                       line_1, lineId, TIMEOUT);

end;
 

function TMATerminal.DataSend(line_1: OleVariant; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.DataSend(line_1, TIMEOUT);

end;
 

function TMATerminal.EraseLanguageFile(line_1: OleVariant; listIndex: Integer; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.EraseLanguageFile(line_1, listIndex, TIMEOUT);

end;
 

function TMATerminal.LoadLanguageFile(FileName: OleVariant; NbRetry: SYSINT; TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.LoadLanguageFile(FileName, NbRetry, TIMEOUT);

end;
 

function TMATerminal.AddSeveralRecords(const DataBase: IMADB; NbRetry: Smallint; var Stop: Integer; 

                                       TIMEOUT: Integer): Smallint;

begin

  Result := DefaultInterface.AddSeveralRecords(DataBase, NbRetry, Stop, TIMEOUT);

end;
 

function TMATerminal.setComMode(i_e_comMode: SYSINT): SYSINT;

begin

  Result := DefaultInterface.setComMode(i_e_comMode);

end;
 

function TMATerminal.getComMode: SYSINT;

begin

  Result := DefaultInterface.getComMode;

end;
 

function TMATerminal.initSSL(const i_bstr_passphrase: WideString): SYSINT;

begin

  Result := DefaultInterface.initSSL(i_bstr_passphrase);

end;
 

function TMATerminal.executeRequestFile(const i_cs_REQfilename: WideString; 

                                        const i_cs_REPfilename: WideString; i_i_timeout: SYSINT): SYSINT;

begin

  Result := DefaultInterface.executeRequestFile(i_cs_REQfilename, i_cs_REPfilename, i_i_timeout);

end;
 

function TMATerminal.cmdDir(const i_pc_diskName: WideString; var o_pv_data: OleVariant; 

                            var o_pi_length: SYSINT): SYSINT;

begin

  Result := DefaultInterface.cmdDir(i_pc_diskName, o_pv_data, o_pi_length);

end;
 

function TMATerminal.SetMultipleRegistryKey(i_i_numberOfKeys: SYSINT; i_px_keys: PSafeArray; 

                                            i_i_timeout: SYSINT): SYSINT;

begin

  Result := DefaultInterface.SetMultipleRegistryKey(i_i_numberOfKeys, i_px_keys, i_i_timeout);

end;
 

function TMATerminal.SetMIFAREKey(TIMEOUT: Integer; KeyNumber: Smallint; SectorNum: Smallint; 

                                  KeySector: OleVariant): Smallint;

begin

  Result := DefaultInterface.SetMIFAREKey(TIMEOUT, KeyNumber, SectorNum, KeySector);

end;
 

function TMATerminal.SendCustomCommand(const i_cs_RequestString: WideString; 

                                       var o_cs_ReplyString: WideString; 

                                       var i_replyLength: LongWord; i_i_timeout: Integer): Smallint;

begin

  Result := DefaultInterface.SendCustomCommand(i_cs_RequestString, o_cs_ReplyString, i_replyLength, 

                                               i_i_timeout);

end;
 

procedure TMATerminal.SpecialRequest(i_i_RequestType: SYSINT; var i_pv_DataIn: OleVariant; 

                                     i_i_DataInLength: SYSINT; var o_pv_DataOut: OleVariant; 

                                     var i_pi_DataOutLength: SYSINT);

begin

  DefaultInterface.SpecialRequest(i_i_RequestType, i_pv_DataIn, i_i_DataInLength, o_pv_DataOut, 

                                  i_pi_DataOutLength);

end;
 

procedure TMATerminal.GetLicenseStatus(var o_hLicenseStatus: SYSINT);

begin

  DefaultInterface.GetLicenseStatus(o_hLicenseStatus);

end;
 

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}

constructor TMATerminalProperties.Create(AServer: TMATerminal);

begin

  inherited Create;

  FServer := AServer;

end;
 

function TMATerminalProperties.GetDefaultInterface: IMATerminal;

begin

  Result := FServer.DefaultInterface;

end;
 

{$ENDIF}
 

procedure Register;

begin

  RegisterComponents(dtlServerPage, [TMADB, TMADBReport, TMALogReport, TMALogs, 

    TMAOptions, TMARecord, TMATerminal]);

end;
 

end.

Open in new window

0
Comment
Question by:LucEngelen
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
twocandles earned 500 total points
Comment Utility
According to this:

RetrieveMAConfig(const MAOpt: IMAOptions; TIMEOUT: Integer; WiegandOrDC: Integer): Smallint;

this function takes the IMAOptions as a const input parameter, so you cannot receive a new instance of that interface with this function. Are you sure this is the correct way to retrieve the IMAOptions interface?

In the code snippet you provided, this is line 1812:

Result := CreateRemoteComObject(MachineName, CLASS_MAOptions) as IMAOptions;

The library itself seems to be using this method to get the IMAOptions...
0
 

Author Comment

by:LucEngelen
Comment Utility
Yes, its a constant.  I believe that this may be because its expecting a pointer to IMAOptions, but this makes no sense at all to me since as far as I understand, an interface is basicly an abstract class, and in order to use an interface a class has to be derived from it.  I think I need to go pick up a book on COM/OLE programming.

With your hint though, I've at least been able to set the time on the device, so I'll give you the points.  I'll see how much further I can muddle from here ;)

function SetTime : integer;
var
  terminal : TMATerminal;
  i : integer;
  options : IMAOptions;

begin
  terminal := TMATerminal.Create(nil);

  options := CoMAOptions.Create;
  options.Reset;
  options.SetDateTimeConf(FormatDateTime('ddmmyyhhnnss', now));

  terminal.SetParam('IPADRESS', '192.168.73.244');
  terminal.SetParam('PORTNUMBER', 11010);
  terminal.GetParam('SERIALNUM', value);
  result := terminal.SendMAConfig(options, 5000);
  terminal.Free;
end;

0
 
LVL 6

Expert Comment

by:twocandles
Comment Utility
Glad to help and thank you for the points!

Delphi is tricky when working with interfaces. If you have programmed before with C++ or Java, you know you can cast an interface to the underlying object. In fact, in Java and C++, the variable points to the same memory address and it only makes a difference for the compiler. In Delphi, an interface is a different "entity" than the underlying class. In fact, the interface is a group of pointers to the functions of the implementing class. Don't treat interfaces as abstract classes (when casting and such): though the concept is similar, they are managed quite differently.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now