Thema: Delphi COM-Object mit Events

Einzelnen Beitrag anzeigen

markus.waibel

Registriert seit: 15. Mär 2006
11 Beiträge
 
Delphi 7 Architect
 
#17

Re: COM-Object mit Events

  Alt 9. Aug 2007, 19:11
Jetzt mal das ganze Interface aus der TLB
Delphi-Quellcode:
// *********************************************************************//
// In dieser Typbibliothek deklarierte GUIDS . Es werden folgende
// Präfixe verwendet:
// Typbibliotheken : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Nicht-DISP-Schnittstellen: IID_xxxx
// *********************************************************************//
const
...
  IID__API: TGUID = '{52CDEDBE-662A-4D52-8160-71C55A79234F}';
  DIID___API: TGUID = '{460D1860-72C8-41ED-A96A-0407A57648EE}';
  CLASS_API: TGUID = '{3BFC670F-236D-425D-B387-7B95F4339258}';
...

// *********************************************************************//
// Forward-Deklaration von in der Typbibliothek definierten Typen
// *********************************************************************//
  _API = interface;
  _APIDisp = dispinterface;
  __API = dispinterface;
...
// *********************************************************************//
// Deklaration von in der Typbibliothek definierten CoClasses
// (HINWEIS: Hier wird jede CoClass zu ihrer Standardschnittstelle
// zugewiesen)
// *********************************************************************//
  API = _API;
...

// *********************************************************************//
// Schnittstelle: _API
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {52CDEDBE-662A-4D52-8160-71C55A79234F}
// *********************************************************************//
  _API = interface(IDispatch)
    ['{52CDEDBE-662A-4D52-8160-71C55A79234F}']
    function Get_IsReady: WordBool; safecall;
    function Get_IsBusy: WordBool; safecall;
    procedure Set_POSDeviceID(const Param1: WideString); safecall;
    function Get_POSDeviceID: WideString; safecall;
    procedure Set_POSOperatorID(const Param1: WideString); safecall;
    function Get_POSOperatorID: WideString; safecall;
    procedure Set_POSReferenceID(const Param1: WideString); safecall;
    function Get_POSReferenceID: WideString; safecall;
    function SimpleProduct(const ProductID: WideString): WordBool; safecall;
    procedure Set_SovereignName(const Param1: WideString); safecall;
    function Get_SovereignName: WideString; safecall;
    procedure Set_SovereignVersion(const Param1: WideString); safecall;
    function Get_SovereignVersion: WideString; safecall;
    procedure Set_TrainingMode(Param1: WordBool); safecall;
    function Get_TrainingMode: WordBool; safecall;
    function Get_Version: WideString; safecall;
    procedure Set_WellBehaved(Param1: WordBool); safecall;
    function Get_WellBehaved: WordBool; safecall;
    function UserInterface: _UserInterface; safecall;
    function Basket: _Basket; safecall;
    function Journal: _Journal; safecall;
    function Settings: _Settings; safecall;
    procedure InjectData(Data: OleVariant; Device: Integer); safecall;
    procedure InjectCancel(Cancel: WordBool); safecall;
    function Get_IsAssigned: WordBool; safecall;
    procedure Set_POSInfo(const Name: WideString; const Param2: WideString); safecall;
    function Get_POSInfo(const Name: WideString): WideString; safecall;
    function Eftpos: _Eftpos; safecall;
    function Assign1(var HardwareID: WideString; var AssignCode1: WideString;
                     var AssignCode2: WideString; var Force: WordBool): WideString; safecall;
    function Assign2(var Args: PSafeArray): WideString; safecall;
    function Assign3: WideString; safecall;
    property IsReady: WordBool read Get_IsReady;
    property IsBusy: WordBool read Get_IsBusy;
    property POSDeviceID: WideString read Get_POSDeviceID write Set_POSDeviceID;
    property POSOperatorID: WideString read Get_POSOperatorID write Set_POSOperatorID;
    property POSReferenceID: WideString read Get_POSReferenceID write Set_POSReferenceID;
    property SovereignName: WideString read Get_SovereignName write Set_SovereignName;
    property SovereignVersion: WideString read Get_SovereignVersion write Set_SovereignVersion;
    property TrainingMode: WordBool read Get_TrainingMode write Set_TrainingMode;
    property Version: WideString read Get_Version;
    property WellBehaved: WordBool read Get_WellBehaved write Set_WellBehaved;
    property IsAssigned: WordBool read Get_IsAssigned;
    property POSInfo[const Name: WideString]: WideString read Get_POSInfo write Set_POSInfo;
  end;
...
// *********************************************************************//
// DispIntf: _APIDisp
// Flags: (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID: {52CDEDBE-662A-4D52-8160-71C55A79234F}
// *********************************************************************//
  _APIDisp = dispinterface
    ['{52CDEDBE-662A-4D52-8160-71C55A79234F}']
    property IsReady: WordBool readonly dispid 1745027081;
    property IsBusy: WordBool readonly dispid 1745027080;
    property POSDeviceID: WideString dispid 1745027079;
    property POSOperatorID: WideString dispid 1745027078;
    property POSReferenceID: WideString dispid 1745027077;
    function SimpleProduct(const ProductID: WideString): WordBool; dispid 1610809356;
    property SovereignName: WideString dispid 1745027076;
    property SovereignVersion: WideString dispid 1745027075;
    property TrainingMode: WordBool dispid 1745027074;
    property Version: WideString readonly dispid 1745027073;
    property WellBehaved: WordBool dispid 1745027072;
    function UserInterface: _UserInterface; dispid 1610809357;
    function Basket: _Basket; dispid 1610809358;
    function Journal: _Journal; dispid 1610809359;
    function Settings: _Settings; dispid 1610809360;
    procedure InjectData(Data: OleVariant; Device: Integer); dispid 1610809361;
    procedure InjectCancel(Cancel: WordBool); dispid 1610809362;
    property IsAssigned: WordBool readonly dispid 1745027092;
    property POSInfo[const Name: WideString]: WideString dispid 1745027091;
    function Eftpos: _Eftpos; dispid 1610809367;
    function Assign1(var HardwareID: WideString; var AssignCode1: WideString;
                     var AssignCode2: WideString; var Force: WordBool): WideString; dispid 1610809368;
    function Assign2(var Args: {??PSafeArray}OleVariant): WideString; dispid 1610809369;
    function Assign3: WideString; dispid 1610809372;
  end;
...
// *********************************************************************//
// DispIntf: __API
// Flags: (4240) Hidden NonExtensible Dispatchable
// GUID: {460D1860-72C8-41ED-A96A-0407A57648EE}
// *********************************************************************//
  __API = dispinterface
    ['{460D1860-72C8-41ED-A96A-0407A57648EE}']
    procedure Surrender(Reason: Integer; const Message: WideString); dispid 1;
    procedure RefuseInterrupt; dispid 2;
    procedure StartDevice(Device: Integer); dispid 3;
    procedure StopDevice(Device: Integer); dispid 4;
    procedure GetData(const Name: WideString; const DataType: WideString; Device: Integer;
                      const ErrorMessage: WideString; var Data: OleVariant; var Cancel: WordBool); dispid 5;
    procedure DataMismatch(Index: Smallint; Data: OleVariant; const Message: WideString); dispid 6;
    procedure ItemAdded(var BasketItem: _BasketItem; var Cancel: WordBool); dispid 7;
    procedure ItemRemoved(var BasketItem: _BasketItem); dispid 8;
    procedure AddItemFailed(const ProductID: WideString; const Message: WideString); dispid 9;
    procedure VoucherAvailable(var Voucher: _Voucher); dispid 10;
    procedure BasketCommitted(NumberOfItems: Smallint); dispid 27;
    procedure BasketSuspended(const handle: WideString); dispid 11;
    procedure SuspendFailed(const Message: WideString); dispid 12;
    procedure ResumeComplete(NumberOfItems: Smallint); dispid 13;
    procedure ResumeFailed(const handle: WideString; const Message: WideString); dispid 14;
    procedure PrintBegin(NumberOfDocuments: Smallint); dispid 15;
    procedure PrintVoucher(const Alignment: WideString); dispid 16;
    procedure PrintText(const Font: WideString; const Emphasis: WideString; CharWidth: Smallint;
                        CharHeight: Smallint; const Alignment: WideString; Indent: Smallint;
                        const Data: WideString); dispid 17;
    procedure PrintLine(Width: Smallint); dispid 18;
    procedure PrintBarcode(const BarcodeType: WideString; Width: Smallint; Height: Smallint;
                           const Alignment: WideString; const Data: WideString); dispid 19;
    procedure PrintGraphicsBegin(const VerticalAlignment: WideString); dispid 20;
    procedure PrintImage(const Alignment: WideString; const FileName: WideString); dispid 21;
    procedure PrintGraphicsEnd; dispid 22;
    procedure PrintCut(HalfCut: WordBool); dispid 23;
    procedure PrintVoucherEnd; dispid 24;
    procedure PrintEnd; dispid 25;
    procedure Closing(const Message: WideString); dispid 26;
  end;
...
Kann mann da irgendwo rauslesen, dass das ganze nicht geht???
  Mit Zitat antworten Zitat