📄 stocklib_tlb.pas
字号:
procedure Set_EnableMinEvent(pVal: Smallint); safecall;
function Get_EnableHisEvent: Smallint; safecall;
procedure Set_EnableHisEvent(pVal: Smallint); safecall;
function Get_EnableNewsEvent: Smallint; safecall;
procedure Set_EnableNewsEvent(pVal: Smallint); safecall;
function Get_EnableBaseFileEvent: Smallint; safecall;
procedure Set_EnableBaseFileEvent(pVal: Smallint); safecall;
function Get_STKNumInMarket: Integer; safecall;
function ToString(nBufLen: SYSINT; pBuf: Integer): WideString; safecall;
function ReceiveEx: Integer; safecall;
property BackColor: OLE_COLOR read Get_BackColor write Set_BackColor;
property Channel: WideString read Get_Channel;
property Provider: WideString read Get_Provider;
property RcvIDCode: WideString read Get_RcvIDCode;
property Version: WideString read Get_Version;
property TotalNumber: Integer read Get_TotalNumber;
property EnableReportEvent: Smallint read Get_EnableReportEvent write Set_EnableReportEvent;
property EnableMinEvent: Smallint read Get_EnableMinEvent write Set_EnableMinEvent;
property EnableHisEvent: Smallint read Get_EnableHisEvent write Set_EnableHisEvent;
property EnableNewsEvent: Smallint read Get_EnableNewsEvent write Set_EnableNewsEvent;
property EnableBaseFileEvent: Smallint read Get_EnableBaseFileEvent write Set_EnableBaseFileEvent;
property STKNumInMarket: Integer read Get_STKNumInMarket;
end;
// *********************************************************************//
// DispIntf: IStockDriverDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9FD507C9-E42F-11D2-B30C-00C04FCCA334}
// *********************************************************************//
IStockDriverDisp = dispinterface
['{9FD507C9-E42F-11D2-B30C-00C04FCCA334}']
property BackColor: OLE_COLOR dispid -501;
property Channel: WideString readonly dispid 1;
property Provider: WideString readonly dispid 2;
property RcvIDCode: WideString readonly dispid 3;
property Version: WideString readonly dispid 4;
property TotalNumber: Integer readonly dispid 5;
procedure Receive; dispid 6;
procedure Stop; dispid 7;
procedure Setup(bShowWnd: Integer); dispid 8;
property EnableReportEvent: Smallint dispid 9;
property EnableMinEvent: Smallint dispid 10;
property EnableHisEvent: Smallint dispid 11;
property EnableNewsEvent: Smallint dispid 12;
property EnableBaseFileEvent: Smallint dispid 13;
property STKNumInMarket: Integer readonly dispid 14;
function ToString(nBufLen: SYSINT; pBuf: Integer): WideString; dispid 15;
function ReceiveEx: Integer; dispid 16;
end;
// *********************************************************************//
// Interface: IStockDriver2
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {7EC46973-C25F-42E3-B22E-806D3FC5C20E}
// *********************************************************************//
IStockDriver2 = interface(IDispatch)
['{7EC46973-C25F-42E3-B22E-806D3FC5C20E}']
function Get_EnableNewFormat: Integer; safecall;
procedure Set_EnableNewFormat(pVal: Integer); safecall;
property EnableNewFormat: Integer read Get_EnableNewFormat write Set_EnableNewFormat;
end;
// *********************************************************************//
// DispIntf: IStockDriver2Disp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {7EC46973-C25F-42E3-B22E-806D3FC5C20E}
// *********************************************************************//
IStockDriver2Disp = dispinterface
['{7EC46973-C25F-42E3-B22E-806D3FC5C20E}']
property EnableNewFormat: Integer dispid 1;
end;
// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name : TStockDriver
// Help String : StockDriver Class
// Default Interface: IStockDriver
// Def. Intf. DISP? : No
// Event Interface: _IStockDriverEvents
// TypeFlags : (2) CanCreate
// *********************************************************************//
TStockDriverOnReport = procedure(ASender: TObject; nPacket: Integer; pBuf: Integer) of object;
TStockDriverOnMinData = procedure(ASender: TObject; nPacket: Integer; pBuf: Integer) of object;
TStockDriverOnHistory = procedure(ASender: TObject; nPacketNum: Integer; pBuf: Integer) of object;
TStockDriverOnNewsFile = procedure(ASender: TObject; NewsType: Integer; SerialNo: Integer;
const pFileName: WideString;
nFileLen: Integer; pBuf: Integer) of object;
TStockDriverOnBaseFile = procedure(ASender: TObject; const strFileName: WideString;
Market: Smallint; nFileLen: Integer;
pBuf: Integer) of object;
TStockDriver = class(TOleControl)
private
FOnReport: TStockDriverOnReport;
FOnMinData: TStockDriverOnMinData;
FOnHistory: TStockDriverOnHistory;
FOnNewsFile: TStockDriverOnNewsFile;
FOnBaseFile: TStockDriverOnBaseFile;
FIntf: IStockDriver;
function GetControlInterface: IStockDriver;
protected
procedure CreateControl;
procedure InitControlData; override;
public
procedure Receive;
procedure Stop;
procedure Setup(bShowWnd: Integer);
function ToString(nBufLen: SYSINT; pBuf: Integer): WideString;
function ReceiveEx: Integer;
property ControlInterface: IStockDriver read GetControlInterface;
property DefaultInterface: IStockDriver read GetControlInterface;
property Channel: WideString index 1 read GetWideStringProp;
property Provider: WideString index 2 read GetWideStringProp;
property RcvIDCode: WideString index 3 read GetWideStringProp;
property Version: WideString index 4 read GetWideStringProp;
property TotalNumber: Integer index 5 read GetIntegerProp;
property STKNumInMarket: Integer index 14 read GetIntegerProp;
published
property Anchors;
property ParentColor;
property TabStop;
property Align;
property DragCursor;
property DragMode;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property Visible;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnStartDrag;
property BackColor: TColor index -501 read GetTColorProp write SetTColorProp stored False;
property EnableReportEvent: Smallint index 9 read GetSmallintProp write SetSmallintProp stored False;
property EnableMinEvent: Smallint index 10 read GetSmallintProp write SetSmallintProp stored False;
property EnableHisEvent: Smallint index 11 read GetSmallintProp write SetSmallintProp stored False;
property EnableNewsEvent: Smallint index 12 read GetSmallintProp write SetSmallintProp stored False;
property EnableBaseFileEvent: Smallint index 13 read GetSmallintProp write SetSmallintProp stored False;
property OnReport: TStockDriverOnReport read FOnReport write FOnReport;
property OnMinData: TStockDriverOnMinData read FOnMinData write FOnMinData;
property OnHistory: TStockDriverOnHistory read FOnHistory write FOnHistory;
property OnNewsFile: TStockDriverOnNewsFile read FOnNewsFile write FOnNewsFile;
property OnBaseFile: TStockDriverOnBaseFile read FOnBaseFile write FOnBaseFile;
end;
// *********************************************************************//
// The Class CoStockReport provides a Create and CreateRemote method to
// create instances of the default interface IStockReport exposed by
// the CoClass StockReport. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoStockReport = class
class function Create: IStockReport;
class function CreateRemote(const MachineName: string): IStockReport;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TStockReport
// Help String : StockReport Class
// Default Interface: IStockReport
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TStockReportProperties= class;
{$ENDIF}
TStockReport = class(TOleServer)
private
FIntf: IStockReport;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TStockReportProperties;
function GetServerProperties: TStockReportProperties;
{$ENDIF}
function GetDefaultInterface: IStockReport;
protected
procedure InitServerData; override;
function Get_ArrayIndexer: Smallint;
procedure Set_ArrayIndexer(pVal: Smallint);
function Get_strLabel: WideString;
function Get_Time: TDateTime;
function Get_strName: WideString;
function Get_Market: OLE_MARKET_ENUM;
function Get_LastClose: Single;
function Get_OpenPrice: Single;
function Get_HighPrice: Single;
function Get_LowPrice: Single;
function Get_NewPrice: Single;
function Get_Volume: Single;
function Get_Amount: Single;
function Get_BuyPrice(i: Smallint): Single;
function Get_BuyVolume(i: Smallint): Single;
function Get_SellPrice(i: Smallint): Single;
function Get_SellVolume(i: Smallint): Single;
function Get_ElementAt(nNo: SYSINT): OLE_RCV_REPORT;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IStockReport);
procedure Disconnect; override;
procedure Attach(nPacketNum: Integer; pDataBuf: Integer);
property DefaultInterface: IStockReport read GetDefaultInterface;
property strLabel: WideString read Get_strLabel;
property Time: TDateTime read Get_Time;
property strName: WideString read Get_strName;
property Market: OLE_MARKET_ENUM read Get_Market;
property LastClose: Single read Get_LastClose;
property OpenPrice: Single read Get_OpenPrice;
property HighPrice: Single read Get_HighPrice;
property LowPrice: Single read Get_LowPrice;
property NewPrice: Single read Get_NewPrice;
property Volume: Single read Get_Volume;
property Amount: Single read Get_Amount;
property BuyPrice[i: Smallint]: Single read Get_BuyPrice;
property BuyVolume[i: Smallint]: Single read Get_BuyVolume;
property SellPrice[i: Smallint]: Single read Get_SellPrice;
property SellVolume[i: Smallint]: Single read Get_SellVolume;
property ElementAt[nNo: SYSINT]: OLE_RCV_REPORT read Get_ElementAt;
property ArrayIndexer: Smallint read Get_ArrayIndexer write Set_ArrayIndexer;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TStockReportProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TStockReport
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TStockReportProperties = class(TPersistent)
private
FServer: TStockReport;
function GetDefaultInterface: IStockReport;
constructor Create(AServer: TStockReport);
protected
function Get_ArrayIndexer: Smallint;
procedure Set_ArrayIndexer(pVal: Smallint);
function Get_strLabel: WideString;
function Get_Time: TDateTime;
function Get_strName: WideString;
function Get_Market: OLE_MARKET_ENUM;
function Get_LastClose: Single;
function Get_OpenPrice: Single;
function Get_HighPrice: Single;
function Get_LowPrice: Single;
function Get_NewPrice: Single;
function Get_Volume: Single;
function Get_Amount: Single;
function Get_BuyPrice(i: Smallint): Single;
function Get_BuyVolume(i: Smallint): Single;
function Get_SellPrice(i: Smallint): Single;
function Get_SellVolume(i: Smallint): Single;
function Get_ElementAt(nNo: SYSINT): OLE_RCV_REPORT;
public
property DefaultInterface: IStockReport read GetDefaultInterface;
published
property ArrayIndexer: Smallint read Get_ArrayIndexer write Set_ArrayIndexer;
end;
{$ENDIF}
// *********************************************************************//
// The Class CoStockMinData provides a Create and CreateRemote method to
// create instances of the default interface IStockMinData exposed by
// the CoClass StockMinData. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoStockMinData = class
class function Create: IStockMinData;
class function CreateRemote(const MachineName: string): IStockMinData;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TStockMinData
// Help String : StockMinData Class
// Default Interface: IStockMinData
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TStockMinDataProperties= class;
{$ENDIF}
TStockMinData = class(TOleServer)
private
FIntf: IStockMinData;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TStockMinDataProperties;
function GetServerProperties: TStockMinDataProperties;
{$ENDIF}
function GetDefaultInterface: IStockMinData;
protected
procedure InitServerData; override;
function Get_ArrayIndexer: Smallint;
function Get_strLabel: WideString;
function Get_Market: OLE_MARKET_ENUM;
function Get_Time: TDateTime;
function Get_Price: Single;
function Get_Volume: Single;
function Get_Amount: Single;
function Get_PacketNum: Smallint;
function Get_ElementAt(i: Integer): OLE_RCV_MINUTE;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IStockMinData);
procedure Disconnect; override;
procedure Attach(nPacketNum: Smallint; pDataBuf: Integer);
procedure Next;
property DefaultInterface: IStockMinData read GetDefaultInterface;
property ArrayIndexer: Smallint read Get_ArrayIndexer;
property strLabel: WideString read Get_strLabel;
property Market: OLE_MARKET_ENUM read Get_Market;
property Time: TDateTime read Get_Time;
property Price: Single read Get_Price;
property Volume: Single read Get_Volume;
property Amount: Single read Get_Amount;
property PacketNum: Smallint read Get_PacketNum;
property ElementAt[i: Integer]: OLE_RCV_MINUTE read Get_ElementAt;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TStockMinDataProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TStockMinData
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TStockMinDataProperties = class(TPersistent)
private
FServer: TStockMinData;
function GetDefaultInterface: IStockMinData;
constructor Create(AServer: TStockMinData);
protected
function Get_ArrayIndexer: Smallint;
function Get_strLabel: WideString;
function Get_Market: OLE_MARKET_ENUM;
function Get_Time: TDateTime;
function Get_Price: Single;
function Get_Volume: Single;
function Get_Amount: Single;
function Get_PacketNum: Smallint;
function Get_ElementAt(i: Integer): OLE_RCV_MINUTE;
public
property DefaultInterface: IStockMinData read GetDefaultInterface;
published
end;
{$ENDIF}
// *********************************************************************//
// The Class CoStockHisData provides a Create and CreateRemote method to
// create instances of the default interface IStockHisData exposed by
// the CoClass StockHisData. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoStockHisData = class
class function Create: IStockHisData;
class function CreateRemote(const MachineName: string): IStockHisData;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TStockHisData
// Help String : StockHisData Class
// Default Interface: IStockHisData
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TStockHisDataProperties= class;
{$ENDIF}
TStockHisData = class(TOleServer)
private
FIntf: IStockHisData;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TStockHisDataProperties;
function GetServerProperties: TStockHisDataProperties;
{$ENDIF}
function GetDefaultInterface: IStockHisData;
protected
procedure InitServerData; override;
function Get_ArrayIndexer: Integer;
function Get_strLabel: WideString;
function Get_Market: OLE_MARKET_ENUM;
function Get_OpenPrice: Single;
function Get_Time: TDateTime;
function Get_HighPrice: Single;
function Get_LowPrice: Single;
function Get_ClosePrice: Single;
function Get_Volume: Single;
function Get_Amount: Single;
function Get_AdvanceNum: Integer;
function Get_DeclineNum: Integer;
function Get_PacketNum: Integer;
function Get_ElementAt(i: Integer): OLE_RCV_HISTORY;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IStockHisData);
procedure Disconnect; override;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -