⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shortsms_tlb.pas

📁 利用AT指令,直接控制GSM的控制.实现
💻 PAS
📖 第 1 页 / 共 2 页
字号:
                      DataBit: TSMSDataBit; StopBit: TSMSStopBit): Smallint; dispid 217;
    function CloseComm: Smallint; dispid 218;
    function GetModemCSQ: Smallint; dispid 219;
    function GetModemCREG: Smallint; dispid 220;
    function GetModemCPIN: Smallint; dispid 221;
    function SetModemCSCA(const Value: WideString): Smallint; dispid 222;
    function SetModemCMGF(Value: TSMSCMGF): Smallint; dispid 223;
    function SendInfo(const HandNum: WideString; const Info: WideString): Smallint; dispid 224;
    function ReadInfo(Index: {??Word}OleVariant; var HandNum: WideString; var Info: WideString; 
                      var SendTime: WideString): Smallint; dispid 225;
    function ReadNewInfo(var HandNum: WideString; var Info: WideString; var SendTime: WideString): Smallint; dispid 226;
    function DelInfo(Index: {??Word}OleVariant): Smallint; dispid 227;
    function GetModemIMEINO: WideString; dispid 228;
    function SetModemATZ: Smallint; dispid 229;
    function SetModemCNMI: Smallint; dispid 230;
  end;

// *********************************************************************//
// DispIntf:  IShortSMSActiveXEvents
// Flags:     (4096) Dispatchable
// GUID:      {04080778-B1FF-4769-A3A7-781C2E662134}
// *********************************************************************//
  IShortSMSActiveXEvents = dispinterface
    ['{04080778-B1FF-4769-A3A7-781C2E662134}']
    procedure OnActivate; dispid 201;
    procedure OnClick; dispid 202;
    procedure OnCreate; dispid 203;
    procedure OnDblClick; dispid 204;
    procedure OnDestroy; dispid 205;
    procedure OnDeactivate; dispid 206;
    procedure OnKeyPress(var Key: Smallint); dispid 207;
    procedure OnPaint; dispid 208;
  end;


// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name     : TShortSMSActiveX
// Help String      : ShortSMSActiveX Control
// Default Interface: IShortSMSActiveX
// Def. Intf. DISP? : No
// Event   Interface: IShortSMSActiveXEvents
// TypeFlags        : (34) CanCreate Control
// *********************************************************************//
  TShortSMSActiveXOnKeyPress = procedure(ASender: TObject; var Key: Smallint) of object;

  TShortSMSActiveX = class(TOleControl)
  private
    FOnActivate: TNotifyEvent;
    FOnClick: TNotifyEvent;
    FOnCreate: TNotifyEvent;
    FOnDblClick: TNotifyEvent;
    FOnDestroy: TNotifyEvent;
    FOnDeactivate: TNotifyEvent;
    FOnKeyPress: TShortSMSActiveXOnKeyPress;
    FOnPaint: TNotifyEvent;
    FIntf: IShortSMSActiveX;
    function  GetControlInterface: IShortSMSActiveX;
  protected
    procedure CreateControl;
    procedure InitControlData; override;
  public
    procedure AboutBox;
    function OpenComm(CommNum: Word; BaudRate: Integer; Parity: TSMSParity; DataBit: TSMSDataBit; 
                      StopBit: TSMSStopBit): Smallint;
    function CloseComm: Smallint;
    function GetModemCSQ: Smallint;
    function GetModemCREG: Smallint;
    function GetModemCPIN: Smallint;
    function SetModemCSCA(const Value: WideString): Smallint;
    function SetModemCMGF(Value: TSMSCMGF): Smallint;
    function SendInfo(const HandNum: WideString; const Info: WideString): Smallint;
    function ReadInfo(Index: Word; var HandNum: WideString; var Info: WideString; 
                      var SendTime: WideString): Smallint;
    function ReadNewInfo(var HandNum: WideString; var Info: WideString; var SendTime: WideString): Smallint;
    function DelInfo(Index: Word): Smallint;
    function GetModemIMEINO: WideString;
    function SetModemATZ: Smallint;
    function SetModemCNMI: Smallint;
    property  ControlInterface: IShortSMSActiveX read GetControlInterface;
    property  DefaultInterface: IShortSMSActiveX read GetControlInterface;
    property Visible: WordBool index 201 read GetWordBoolProp write SetWordBoolProp;
    property Active: WordBool index 209 read GetWordBoolProp;
    property DropTarget: WordBool index 210 read GetWordBoolProp write SetWordBoolProp;
    property HelpFile: WideString index 211 read GetWideStringProp write SetWideStringProp;
    property ScreenSnap: WordBool index 212 read GetWordBoolProp write SetWordBoolProp;
    property SnapBuffer: Integer index 213 read GetIntegerProp write SetIntegerProp;
    property DoubleBuffered: WordBool index 214 read GetWordBoolProp write SetWordBoolProp;
    property AlignDisabled: WordBool index 215 read GetWordBoolProp;
    property VisibleDockClientCount: Integer index 216 read GetIntegerProp;
    property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp;
  published
    property Anchors;
    property AutoScroll: WordBool index 202 read GetWordBoolProp write SetWordBoolProp stored False;
    property AutoSize: WordBool index 203 read GetWordBoolProp write SetWordBoolProp stored False;
    property AxBorderStyle: TOleEnum index 204 read GetTOleEnumProp write SetTOleEnumProp stored False;
    property Caption: WideString index -518 read GetWideStringProp write SetWideStringProp stored False;
    property Color: TColor index -501 read GetTColorProp write SetTColorProp stored False;
    property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
    property KeyPreview: WordBool index 205 read GetWordBoolProp write SetWordBoolProp stored False;
    property PixelsPerInch: Integer index 206 read GetIntegerProp write SetIntegerProp stored False;
    property PrintScale: TOleEnum index 207 read GetTOleEnumProp write SetTOleEnumProp stored False;
    property Scaled: WordBool index 208 read GetWordBoolProp write SetWordBoolProp stored False;
    property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
    property OnClick: TNotifyEvent read FOnClick write FOnClick;
    property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
    property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
    property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
    property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
    property OnKeyPress: TShortSMSActiveXOnKeyPress read FOnKeyPress write FOnKeyPress;
    property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
  end;

procedure Register;

resourcestring
  dtlServerPage = 'Servers';

  dtlOcxPage = 'ActiveX';

implementation

uses ComObj;

procedure TShortSMSActiveX.InitControlData;
const
  CEventDispIDs: array [0..7] of DWORD = (
    $000000C9, $000000CA, $000000CB, $000000CC, $000000CD, $000000CE,
    $000000CF, $000000D0);
  CTFontIDs: array [0..0] of DWORD = (
    $FFFFFE00);
  CControlData: TControlData2 = (
    ClassID: '{0E511F06-2115-4287-84D3-FCF1B47D0C2E}';
    EventIID: '{04080778-B1FF-4769-A3A7-781C2E662134}';
    EventCount: 8;
    EventDispIDs: @CEventDispIDs;
    LicenseKey: nil (*HR:$00000000*);
    Flags: $0000001D;
    Version: 401;
    FontCount: 1;
    FontIDs: @CTFontIDs);
begin
  ControlData := @CControlData;
  TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnActivate) - Cardinal(Self);
end;

procedure TShortSMSActiveX.CreateControl;

  procedure DoCreate;
  begin
    FIntf := IUnknown(OleObject) as IShortSMSActiveX;
  end;

begin
  if FIntf = nil then DoCreate;
end;

function TShortSMSActiveX.GetControlInterface: IShortSMSActiveX;
begin
  CreateControl;
  Result := FIntf;
end;

procedure TShortSMSActiveX.AboutBox;
begin
  DefaultInterface.AboutBox;
end;

function TShortSMSActiveX.OpenComm(CommNum: Word; BaudRate: Integer; Parity: TSMSParity; 
                                   DataBit: TSMSDataBit; StopBit: TSMSStopBit): Smallint;
begin
  Result := DefaultInterface.OpenComm(CommNum, BaudRate, Parity, DataBit, StopBit);
end;

function TShortSMSActiveX.CloseComm: Smallint;
begin
  Result := DefaultInterface.CloseComm;
end;

function TShortSMSActiveX.GetModemCSQ: Smallint;
begin
  Result := DefaultInterface.GetModemCSQ;
end;

function TShortSMSActiveX.GetModemCREG: Smallint;
begin
  Result := DefaultInterface.GetModemCREG;
end;

function TShortSMSActiveX.GetModemCPIN: Smallint;
begin
  Result := DefaultInterface.GetModemCPIN;
end;

function TShortSMSActiveX.SetModemCSCA(const Value: WideString): Smallint;
begin
  Result := DefaultInterface.SetModemCSCA(Value);
end;

function TShortSMSActiveX.SetModemCMGF(Value: TSMSCMGF): Smallint;
begin
  Result := DefaultInterface.SetModemCMGF(Value);
end;

function TShortSMSActiveX.SendInfo(const HandNum: WideString; const Info: WideString): Smallint;
begin
  Result := DefaultInterface.SendInfo(HandNum, Info);
end;

function TShortSMSActiveX.ReadInfo(Index: Word; var HandNum: WideString; var Info: WideString; 
                                   var SendTime: WideString): Smallint;
begin
  Result := DefaultInterface.ReadInfo(Index, HandNum, Info, SendTime);
end;

function TShortSMSActiveX.ReadNewInfo(var HandNum: WideString; var Info: WideString; 
                                      var SendTime: WideString): Smallint;
begin
  Result := DefaultInterface.ReadNewInfo(HandNum, Info, SendTime);
end;

function TShortSMSActiveX.DelInfo(Index: Word): Smallint;
begin
  Result := DefaultInterface.DelInfo(Index);
end;

function TShortSMSActiveX.GetModemIMEINO: WideString;
begin
  Result := DefaultInterface.GetModemIMEINO;
end;

function TShortSMSActiveX.SetModemATZ: Smallint;
begin
  Result := DefaultInterface.SetModemATZ;
end;

function TShortSMSActiveX.SetModemCNMI: Smallint;
begin
  Result := DefaultInterface.SetModemCNMI;
end;

procedure Register;
begin
  RegisterComponents(dtlOcxPage, [TShortSMSActiveX]);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -