{ ***************************************************************************** WARNING: This component file was generated using the EventSinkImp utility. The contents of this file will be overwritten everytime EventSinkImp is asked to regenerate this sink component. NOTE: When using this component at the same time with the XXX_TLB.pas in your Delphi projects, make sure you always put the XXX_TLB unit name AFTER this component unit name in the USES clause of the interface section of your unit; otherwise you may get interface conflict errors from the Delphi compiler. EventSinkImp is written by Binh Ly (bly@techvanguards.com) ***************************************************************************** //Sink Classes// TPHIDGETIPhidgetManagerEvents TPHIDGETIPhidgetPowerBarEvents TPHIDGETIPhidgetServoEvents TPHIDGETIPhidgetInterfaceKitEvents TPHIDGETIPhidgetMarmotEvents TPHIDGETIPhidgetRFIDEvents TPHIDGETIPhidgetPowerEvents TPHIDGETIPhidgetPenTrayEvents TPHIDGETIPhidgetTextLCDEvents TPHIDGETIPhidgetGraphicLCDEvents TPHIDGETIPhidgetAdvancedServoEvents TPHIDGETIPhidgetLEDEvents TPHIDGETIPhidgetEncoderEvents TPHIDGETIPhidgetStepperEvents } {$IFDEF VER100} {$DEFINE D3} {$ENDIF} //SinkUnitName// unit PHIDGETEvents; interface uses Windows, ActiveX, Classes, ComObj, OleCtrls //SinkUses// , StdVCL //, PHIDGET_TLB , PhidgetLib ; type { backward compatibility types } {$IFDEF D3} OLE_COLOR = TOleColor; {$ENDIF} TPHIDGETEventsBaseSink = class (TComponent, IUnknown, IDispatch) protected { IUnknown } function QueryInterface(const IID: TGUID; out Obj): HResult; {$IFNDEF D3} override; {$ENDIF} stdcall; function _AddRef: Integer; stdcall; function _Release: Integer; stdcall; { IDispatch } function GetIDsOfNames(const IID: TGUID; Names: Pointer; NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; virtual; stdcall; function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; virtual; stdcall; function GetTypeInfoCount(out Count: Integer): HResult; virtual; stdcall; function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; virtual; stdcall; protected FCookie: integer; FCP: IConnectionPoint; FSinkIID: TGUID; FSource: IUnknown; function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; virtual; abstract; public destructor Destroy; override; procedure Connect (const ASource: IUnknown); procedure Disconnect; property SinkIID: TGUID read FSinkIID write FSinkIID; property Source: IUnknown read FSource; end; //SinkImportsForwards// //SinkImports// //SinkIntfStart// //SinkEventsForwards// T_IPhidgetManagerEventsOnAttachEvent = procedure (Sender: TObject; const PHIDGET: IPhidget) of object; T_IPhidgetManagerEventsOnDetachEvent = procedure (Sender: TObject; const PHIDGET: IPhidget) of object; T_IPhidgetManagerEventsOnErrorEvent = procedure (Sender: TObject; const PHIDGET: IPhidget; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetManagerEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnAttach(const PHIDGET: IPhidget); safecall; procedure DoOnDetach(const PHIDGET: IPhidget); safecall; procedure DoOnError(const PHIDGET: IPhidget; const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnAttach: T_IPhidgetManagerEventsOnAttachEvent; FOnDetach: T_IPhidgetManagerEventsOnDetachEvent; FOnError: T_IPhidgetManagerEventsOnErrorEvent; published //SinkEventsPublished// property OnAttach: T_IPhidgetManagerEventsOnAttachEvent read FOnAttach write FOnAttach; property OnDetach: T_IPhidgetManagerEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetManagerEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetPowerBarEventsOnChangeEvent = procedure (Sender: TObject; Index: Integer; State: WordBool) of object; T_IPhidgetPowerBarEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetPowerBarEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetPowerBarEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnChange(Index: Integer; State: WordBool); safecall; procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnChange: T_IPhidgetPowerBarEventsOnChangeEvent; FOnDetach: T_IPhidgetPowerBarEventsOnDetachEvent; FOnError: T_IPhidgetPowerBarEventsOnErrorEvent; published //SinkEventsPublished// property OnChange: T_IPhidgetPowerBarEventsOnChangeEvent read FOnChange write FOnChange; property OnDetach: T_IPhidgetPowerBarEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetPowerBarEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetServoEventsOnPositionChangeEvent = procedure (Sender: TObject; Index: Integer; Position: Single) of object; T_IPhidgetServoEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetServoEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetServoEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnPositionChange(Index: Integer; Position: Single); safecall; procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnPositionChange: T_IPhidgetServoEventsOnPositionChangeEvent; FOnDetach: T_IPhidgetServoEventsOnDetachEvent; FOnError: T_IPhidgetServoEventsOnErrorEvent; published //SinkEventsPublished// property OnPositionChange: T_IPhidgetServoEventsOnPositionChangeEvent read FOnPositionChange write FOnPositionChange; property OnDetach: T_IPhidgetServoEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetServoEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetInterfaceKitEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetInterfaceKitEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; T_IPhidgetInterfaceKitEventsOnInputChangeEvent = procedure (Sender: TObject; Index: Integer; NewState: WordBool) of object; T_IPhidgetInterfaceKitEventsOnOutputChangeEvent = procedure (Sender: TObject; Index: Integer; NewState: WordBool) of object; T_IPhidgetInterfaceKitEventsOnSensorChangeEvent = procedure (Sender: TObject; Index: Integer; SensorValue: Integer) of object; //SinkComponent// TPHIDGETIPhidgetInterfaceKitEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; procedure DoOnInputChange(Index: Integer; NewState: WordBool); safecall; procedure DoOnOutputChange(Index: Integer; NewState: WordBool); safecall; procedure DoOnSensorChange(Index: Integer; SensorValue: Integer); safecall; protected //SinkEventsProtected// FOnDetach: T_IPhidgetInterfaceKitEventsOnDetachEvent; FOnError: T_IPhidgetInterfaceKitEventsOnErrorEvent; FOnInputChange: T_IPhidgetInterfaceKitEventsOnInputChangeEvent; FOnOutputChange: T_IPhidgetInterfaceKitEventsOnOutputChangeEvent; FOnSensorChange: T_IPhidgetInterfaceKitEventsOnSensorChangeEvent; published //SinkEventsPublished// property OnDetach: T_IPhidgetInterfaceKitEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetInterfaceKitEventsOnErrorEvent read FOnError write FOnError; property OnInputChange: T_IPhidgetInterfaceKitEventsOnInputChangeEvent read FOnInputChange write FOnInputChange; property OnOutputChange: T_IPhidgetInterfaceKitEventsOnOutputChangeEvent read FOnOutputChange write FOnOutputChange; property OnSensorChange: T_IPhidgetInterfaceKitEventsOnSensorChangeEvent read FOnSensorChange write FOnSensorChange; end; //SinkEventsForwards// T_IPhidgetMarmotEventsOnButtonDownEvent = procedure (Sender: TObject; Button: Integer; X: Integer; Y: Integer) of object; T_IPhidgetMarmotEventsOnButtonUpEvent = procedure (Sender: TObject; Button: Integer; X: Integer; Y: Integer) of object; T_IPhidgetMarmotEventsOnMoveEvent = procedure (Sender: TObject; Button: Integer; X: Integer; Y: Integer) of object; T_IPhidgetMarmotEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetMarmotEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetMarmotEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnButtonDown(Button: Integer; X: Integer; Y: Integer); safecall; procedure DoOnButtonUp(Button: Integer; X: Integer; Y: Integer); safecall; procedure DoOnMove(Button: Integer; X: Integer; Y: Integer); safecall; procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnButtonDown: T_IPhidgetMarmotEventsOnButtonDownEvent; FOnButtonUp: T_IPhidgetMarmotEventsOnButtonUpEvent; FOnMove: T_IPhidgetMarmotEventsOnMoveEvent; FOnDetach: T_IPhidgetMarmotEventsOnDetachEvent; FOnError: T_IPhidgetMarmotEventsOnErrorEvent; published //SinkEventsPublished// property OnButtonDown: T_IPhidgetMarmotEventsOnButtonDownEvent read FOnButtonDown write FOnButtonDown; property OnButtonUp: T_IPhidgetMarmotEventsOnButtonUpEvent read FOnButtonUp write FOnButtonUp; property OnMove: T_IPhidgetMarmotEventsOnMoveEvent read FOnMove write FOnMove; property OnDetach: T_IPhidgetMarmotEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetMarmotEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetRFIDEventsOnTagEvent = procedure (Sender: TObject; Index: Integer; const TagNumber: WideString) of object; T_IPhidgetRFIDEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetRFIDEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetRFIDEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnTag(Index: Integer; const TagNumber: WideString); safecall; procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnTag: T_IPhidgetRFIDEventsOnTagEvent; FOnDetach: T_IPhidgetRFIDEventsOnDetachEvent; FOnError: T_IPhidgetRFIDEventsOnErrorEvent; published //SinkEventsPublished// property OnTag: T_IPhidgetRFIDEventsOnTagEvent read FOnTag write FOnTag; property OnDetach: T_IPhidgetRFIDEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetRFIDEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetPowerEventsOnCurrentChangeEvent = procedure (Sender: TObject; Index: Integer; Position: Integer) of object; T_IPhidgetPowerEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetPowerEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetPowerEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnCurrentChange(Index: Integer; Position: Integer); safecall; procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnCurrentChange: T_IPhidgetPowerEventsOnCurrentChangeEvent; FOnDetach: T_IPhidgetPowerEventsOnDetachEvent; FOnError: T_IPhidgetPowerEventsOnErrorEvent; published //SinkEventsPublished// property OnCurrentChange: T_IPhidgetPowerEventsOnCurrentChangeEvent read FOnCurrentChange write FOnCurrentChange; property OnDetach: T_IPhidgetPowerEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetPowerEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetPenTrayEventsOnPacketEvent = procedure (Sender: TObject; Length: Integer; const Data: WideString) of object; T_IPhidgetPenTrayEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetPenTrayEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetPenTrayEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnPacket(Length: Integer; const Data: WideString); safecall; procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnPacket: T_IPhidgetPenTrayEventsOnPacketEvent; FOnDetach: T_IPhidgetPenTrayEventsOnDetachEvent; FOnError: T_IPhidgetPenTrayEventsOnErrorEvent; published //SinkEventsPublished// property OnPacket: T_IPhidgetPenTrayEventsOnPacketEvent read FOnPacket write FOnPacket; property OnDetach: T_IPhidgetPenTrayEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetPenTrayEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetTextLCDEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetTextLCDEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetTextLCDEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnDetach: T_IPhidgetTextLCDEventsOnDetachEvent; FOnError: T_IPhidgetTextLCDEventsOnErrorEvent; published //SinkEventsPublished// property OnDetach: T_IPhidgetTextLCDEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetTextLCDEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetGraphicLCDEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetGraphicLCDEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetGraphicLCDEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnDetach: T_IPhidgetGraphicLCDEventsOnDetachEvent; FOnError: T_IPhidgetGraphicLCDEventsOnErrorEvent; published //SinkEventsPublished// property OnDetach: T_IPhidgetGraphicLCDEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetGraphicLCDEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetAdvancedServoEventsOnPositionChangeEvent = procedure (Sender: TObject; Index: Integer; Position: Single) of object; T_IPhidgetAdvancedServoEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetAdvancedServoEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetAdvancedServoEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnPositionChange(Index: Integer; Position: Single); safecall; procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnPositionChange: T_IPhidgetAdvancedServoEventsOnPositionChangeEvent; FOnDetach: T_IPhidgetAdvancedServoEventsOnDetachEvent; FOnError: T_IPhidgetAdvancedServoEventsOnErrorEvent; published //SinkEventsPublished// property OnPositionChange: T_IPhidgetAdvancedServoEventsOnPositionChangeEvent read FOnPositionChange write FOnPositionChange; property OnDetach: T_IPhidgetAdvancedServoEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetAdvancedServoEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetLEDEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetLEDEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetLEDEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnDetach: T_IPhidgetLEDEventsOnDetachEvent; FOnError: T_IPhidgetLEDEventsOnErrorEvent; published //SinkEventsPublished// property OnDetach: T_IPhidgetLEDEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetLEDEventsOnErrorEvent read FOnError write FOnError; end; //SinkEventsForwards// T_IPhidgetEncoderEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetEncoderEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; T_IPhidgetEncoderEventsOnPushButtonChangeEvent = procedure (Sender: TObject; Index: Integer; NewState: WordBool) of object; T_IPhidgetEncoderEventsOnPositionChangeEvent = procedure (Sender: TObject; Index: Integer; EncoderDisplacement: Integer; Time: Integer) of object; //SinkComponent// TPHIDGETIPhidgetEncoderEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; procedure DoOnPushButtonChange(Index: Integer; NewState: WordBool); safecall; procedure DoOnPositionChange(Index: Integer; EncoderDisplacement: Integer; Time: Integer); safecall; protected //SinkEventsProtected// FOnDetach: T_IPhidgetEncoderEventsOnDetachEvent; FOnError: T_IPhidgetEncoderEventsOnErrorEvent; FOnPushButtonChange: T_IPhidgetEncoderEventsOnPushButtonChangeEvent; FOnPositionChange: T_IPhidgetEncoderEventsOnPositionChangeEvent; published //SinkEventsPublished// property OnDetach: T_IPhidgetEncoderEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetEncoderEventsOnErrorEvent read FOnError write FOnError; property OnPushButtonChange: T_IPhidgetEncoderEventsOnPushButtonChangeEvent read FOnPushButtonChange write FOnPushButtonChange; property OnPositionChange: T_IPhidgetEncoderEventsOnPositionChangeEvent read FOnPositionChange write FOnPositionChange; end; //SinkEventsForwards// T_IPhidgetStepperEventsOnPositionChangeEvent = procedure (Sender: TObject; Index: Integer; Position: Single) of object; T_IPhidgetStepperEventsOnDetachEvent = procedure (Sender: TObject) of object; T_IPhidgetStepperEventsOnErrorEvent = procedure (Sender: TObject; const Description: WideString; SCODE: Integer) of object; //SinkComponent// TPHIDGETIPhidgetStepperEvents = class (TPHIDGETEventsBaseSink //ISinkInterface// ) protected function DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; override; //ISinkInterfaceMethods// public { system methods } constructor Create (AOwner: TComponent); override; protected //SinkInterface// procedure DoOnPositionChange(Index: Integer; Position: Single); safecall; procedure DoOnDetach; safecall; procedure DoOnError(const Description: WideString; SCODE: Integer); safecall; protected //SinkEventsProtected// FOnPositionChange: T_IPhidgetStepperEventsOnPositionChangeEvent; FOnDetach: T_IPhidgetStepperEventsOnDetachEvent; FOnError: T_IPhidgetStepperEventsOnErrorEvent; published //SinkEventsPublished// property OnPositionChange: T_IPhidgetStepperEventsOnPositionChangeEvent read FOnPositionChange write FOnPositionChange; property OnDetach: T_IPhidgetStepperEventsOnDetachEvent read FOnDetach write FOnDetach; property OnError: T_IPhidgetStepperEventsOnErrorEvent read FOnError write FOnError; end; //SinkIntfEnd// procedure Register; implementation uses SysUtils; { globals } procedure BuildPositionalDispIds (pDispIds: PDispIdList; const dps: TDispParams); var i: integer; begin Assert (pDispIds <> nil); { by default, directly arrange in reverse order } for i := 0 to dps.cArgs - 1 do pDispIds^ [i] := dps.cArgs - 1 - i; { check for named args } if (dps.cNamedArgs <= 0) then Exit; { parse named args } for i := 0 to dps.cNamedArgs - 1 do pDispIds^ [dps.rgdispidNamedArgs^ [i]] := i; end; { TPHIDGETEventsBaseSink } function TPHIDGETEventsBaseSink.GetIDsOfNames(const IID: TGUID; Names: Pointer; NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; begin Result := E_NOTIMPL; end; function TPHIDGETEventsBaseSink.GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; begin Result := E_NOTIMPL; pointer (TypeInfo) := nil; end; function TPHIDGETEventsBaseSink.GetTypeInfoCount(out Count: Integer): HResult; begin Result := E_NOTIMPL; Count := 0; end; function TPHIDGETEventsBaseSink.Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; var dps: TDispParams absolute Params; bHasParams: boolean; pDispIds: PDispIdList; iDispIdsSize: integer; begin { validity checks } if (Flags AND DISPATCH_METHOD = 0) then raise Exception.Create ( Format ('%s only supports sinking of method calls!', [ClassName] )); { build pDispIds array. this maybe a bit of overhead but it allows us to sink named-argument calls such as Excel's AppEvents, etc! } pDispIds := nil; iDispIdsSize := 0; bHasParams := (dps.cArgs > 0); if (bHasParams) then begin iDispIdsSize := dps.cArgs * SizeOf (TDispId); GetMem (pDispIds, iDispIdsSize); end; { if } try { rearrange dispids properly } if (bHasParams) then BuildPositionalDispIds (pDispIds, dps); Result := DoInvoke (DispId, IID, LocaleID, Flags, dps, pDispIds, VarResult, ExcepInfo, ArgErr); finally { free pDispIds array } if (bHasParams) then FreeMem (pDispIds, iDispIdsSize); end; { finally } end; function TPHIDGETEventsBaseSink.QueryInterface(const IID: TGUID; out Obj): HResult; begin if (GetInterface (IID, Obj)) then begin Result := S_OK; Exit; end else if (IsEqualIID (IID, FSinkIID)) then if (GetInterface (IDispatch, Obj)) then begin Result := S_OK; Exit; end; Result := E_NOINTERFACE; pointer (Obj) := nil; end; function TPHIDGETEventsBaseSink._AddRef: Integer; begin Result := 2; end; function TPHIDGETEventsBaseSink._Release: Integer; begin Result := 1; end; destructor TPHIDGETEventsBaseSink.Destroy; begin Disconnect; inherited; end; procedure TPHIDGETEventsBaseSink.Connect (const ASource: IUnknown); var pcpc: IConnectionPointContainer; begin Assert (ASource <> nil); Disconnect; try OleCheck (ASource.QueryInterface (IConnectionPointContainer, pcpc)); OleCheck (pcpc.FindConnectionPoint (FSinkIID, FCP)); OleCheck (FCP.Advise (Self, FCookie)); FSource := ASource; except raise Exception.Create (Format ('Unable to connect %s.'#13'%s', [Name, Exception (ExceptObject).Message] )); end; { finally } end; procedure TPHIDGETEventsBaseSink.Disconnect; begin //if (FSource = nil) then Exit; if not Assigned(FSource) then Exit; try OleCheck (FCP.Unadvise (FCookie)); FCP := nil; FSource := nil; except pointer (FCP) := nil; pointer (FSource) := nil; end; { except } end; //SinkImplStart// function TPHIDGETIPhidgetManagerEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnAttach (IUnknown (dps.rgvarg^ [pDispIds^ [0]].unkval) as IPhidget); Result := S_OK; end; 2 : begin DoOnDetach (IUnknown (dps.rgvarg^ [pDispIds^ [0]].unkval) as IPhidget); Result := S_OK; end; 3 : begin DoOnError (IUnknown (dps.rgvarg^ [pDispIds^ [0]].unkval) as IPhidget, dps.rgvarg^ [pDispIds^ [1]].bstrval, dps.rgvarg^ [pDispIds^ [2]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetManagerEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetManagerEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetManagerEvents.DoOnAttach(const PHIDGET: IPhidget); begin if not Assigned (OnAttach) then System.Exit; OnAttach (Self, PHIDGET); end; procedure TPHIDGETIPhidgetManagerEvents.DoOnDetach(const PHIDGET: IPhidget); begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self, PHIDGET); end; procedure TPHIDGETIPhidgetManagerEvents.DoOnError(const PHIDGET: IPhidget; const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, PHIDGET, Description, SCODE); end; function TPHIDGETIPhidgetPowerBarEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].vbool); Result := S_OK; end; 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetPowerBarEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetPowerBarEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetPowerBarEvents.DoOnChange(Index: Integer; State: WordBool); begin if not Assigned (OnChange) then System.Exit; OnChange (Self, Index, State); end; procedure TPHIDGETIPhidgetPowerBarEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetPowerBarEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetServoEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnPositionChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].fltval); Result := S_OK; end; 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetServoEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetServoEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetServoEvents.DoOnPositionChange(Index: Integer; Position: Single); begin if not Assigned (OnPositionChange) then System.Exit; OnPositionChange (Self, Index, Position); end; procedure TPHIDGETIPhidgetServoEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetServoEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetInterfaceKitEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnDetach (); Result := S_OK; end; 2 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; 3 : begin DoOnInputChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].vbool); Result := S_OK; end; 4 : begin DoOnOutputChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].vbool); Result := S_OK; end; 5 : begin DoOnSensorChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetInterfaceKitEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetInterfaceKitEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetInterfaceKitEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetInterfaceKitEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; procedure TPHIDGETIPhidgetInterfaceKitEvents.DoOnInputChange(Index: Integer; NewState: WordBool); begin if not Assigned (OnInputChange) then System.Exit; OnInputChange (Self, Index, NewState); end; procedure TPHIDGETIPhidgetInterfaceKitEvents.DoOnOutputChange(Index: Integer; NewState: WordBool); begin if not Assigned (OnOutputChange) then System.Exit; OnOutputChange (Self, Index, NewState); end; procedure TPHIDGETIPhidgetInterfaceKitEvents.DoOnSensorChange(Index: Integer; SensorValue: Integer); begin if not Assigned (OnSensorChange) then System.Exit; OnSensorChange (Self, Index, SensorValue); end; function TPHIDGETIPhidgetMarmotEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnButtonDown (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].lval, dps.rgvarg^ [pDispIds^ [2]].lval); Result := S_OK; end; 2 : begin DoOnButtonUp (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].lval, dps.rgvarg^ [pDispIds^ [2]].lval); Result := S_OK; end; 3 : begin DoOnMove (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].lval, dps.rgvarg^ [pDispIds^ [2]].lval); Result := S_OK; end; 4 : begin DoOnDetach (); Result := S_OK; end; 5 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetMarmotEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetMarmotEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetMarmotEvents.DoOnButtonDown(Button: Integer; X: Integer; Y: Integer); begin if not Assigned (OnButtonDown) then System.Exit; OnButtonDown (Self, Button, X, Y); end; procedure TPHIDGETIPhidgetMarmotEvents.DoOnButtonUp(Button: Integer; X: Integer; Y: Integer); begin if not Assigned (OnButtonUp) then System.Exit; OnButtonUp (Self, Button, X, Y); end; procedure TPHIDGETIPhidgetMarmotEvents.DoOnMove(Button: Integer; X: Integer; Y: Integer); begin if not Assigned (OnMove) then System.Exit; OnMove (Self, Button, X, Y); end; procedure TPHIDGETIPhidgetMarmotEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetMarmotEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetRFIDEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnTag (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].bstrval); Result := S_OK; end; 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetRFIDEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetRFIDEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetRFIDEvents.DoOnTag(Index: Integer; const TagNumber: WideString); begin if not Assigned (OnTag) then System.Exit; OnTag (Self, Index, TagNumber); end; procedure TPHIDGETIPhidgetRFIDEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetRFIDEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetPowerEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnCurrentChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetPowerEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetPowerEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetPowerEvents.DoOnCurrentChange(Index: Integer; Position: Integer); begin if not Assigned (OnCurrentChange) then System.Exit; OnCurrentChange (Self, Index, Position); end; procedure TPHIDGETIPhidgetPowerEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetPowerEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetPenTrayEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnPacket (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].bstrval); Result := S_OK; end; 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetPenTrayEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetPenTrayEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetPenTrayEvents.DoOnPacket(Length: Integer; const Data: WideString); begin if not Assigned (OnPacket) then System.Exit; OnPacket (Self, Length, Data); end; procedure TPHIDGETIPhidgetPenTrayEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetPenTrayEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetTextLCDEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetTextLCDEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetTextLCDEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetTextLCDEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetTextLCDEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetGraphicLCDEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetGraphicLCDEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetGraphicLCDEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetGraphicLCDEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetGraphicLCDEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetAdvancedServoEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnPositionChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].fltval); Result := S_OK; end; 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetAdvancedServoEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetAdvancedServoEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetAdvancedServoEvents.DoOnPositionChange(Index: Integer; Position: Single); begin if not Assigned (OnPositionChange) then System.Exit; OnPositionChange (Self, Index, Position); end; procedure TPHIDGETIPhidgetAdvancedServoEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetAdvancedServoEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetLEDEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetLEDEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetLEDEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetLEDEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetLEDEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; function TPHIDGETIPhidgetEncoderEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; 4 : begin DoOnPushButtonChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].vbool); Result := S_OK; end; 5 : begin DoOnPositionChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].lval, dps.rgvarg^ [pDispIds^ [2]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetEncoderEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetEncoderEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetEncoderEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetEncoderEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; procedure TPHIDGETIPhidgetEncoderEvents.DoOnPushButtonChange(Index: Integer; NewState: WordBool); begin if not Assigned (OnPushButtonChange) then System.Exit; OnPushButtonChange (Self, Index, NewState); end; procedure TPHIDGETIPhidgetEncoderEvents.DoOnPositionChange(Index: Integer; EncoderDisplacement: Integer; Time: Integer); begin if not Assigned (OnPositionChange) then System.Exit; OnPositionChange (Self, Index, EncoderDisplacement, Time); end; function TPHIDGETIPhidgetStepperEvents.DoInvoke (DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var dps: TDispParams; pDispIds: PDispIdList; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant = ^OleVariant; begin Result := DISP_E_MEMBERNOTFOUND; //SinkInvoke// case DispId of 1 : begin DoOnPositionChange (dps.rgvarg^ [pDispIds^ [0]].lval, dps.rgvarg^ [pDispIds^ [1]].fltval); Result := S_OK; end; 2 : begin DoOnDetach (); Result := S_OK; end; 3 : begin DoOnError (dps.rgvarg^ [pDispIds^ [0]].bstrval, dps.rgvarg^ [pDispIds^ [1]].lval); Result := S_OK; end; end; { case } //SinkInvokeEnd// end; constructor TPHIDGETIPhidgetStepperEvents.Create (AOwner: TComponent); begin inherited Create (AOwner); //SinkInit// FSinkIID := _IPhidgetStepperEvents; end; //SinkImplementation// procedure TPHIDGETIPhidgetStepperEvents.DoOnPositionChange(Index: Integer; Position: Single); begin if not Assigned (OnPositionChange) then System.Exit; OnPositionChange (Self, Index, Position); end; procedure TPHIDGETIPhidgetStepperEvents.DoOnDetach; begin if not Assigned (OnDetach) then System.Exit; OnDetach (Self); end; procedure TPHIDGETIPhidgetStepperEvents.DoOnError(const Description: WideString; SCODE: Integer); begin if not Assigned (OnError) then System.Exit; OnError (Self, Description, SCODE); end; //SinkImplEnd// procedure Register; begin //SinkRegisterStart// RegisterComponents ('ActiveX', [TPHIDGETIPhidgetManagerEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetPowerBarEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetServoEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetInterfaceKitEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetMarmotEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetRFIDEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetPowerEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetPenTrayEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetTextLCDEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetGraphicLCDEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetAdvancedServoEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetLEDEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetEncoderEvents]); RegisterComponents ('ActiveX', [TPHIDGETIPhidgetStepperEvents]); //SinkRegisterEnd// end; end.