www.pudn.com > Delphi-sms.rar > EDISONSMSGWLib_TLB.pas


unit EDISONSMSGWLib_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.                                          
// ************************************************************************ // 
 
// PASTLWTR : 1.2 
// File generated on 2005-10-21 12:18:23 from Type Library described below. 
 
// ************************************************************************  // 
// Type Lib: C:\Documents and Settings\administrator\My Documents\EdisonSmsGw.ocx (1) 
// LIBID: {E69A8DCA-B4EE-4D71-938A-7652059D24B7} 
// LCID: 0 
// Helpfile: H:\01_产品开发\02_短信群发(PHS注册版)\硬件二次开发接口\爱迪生信息技术实验室\短信二次开发接口\异步型控件\调用示例代码_delphi\EdisonSmsGw.hlp 
// HelpString: EdisonSmsGw ActiveX Control module 
// DepndLst:  
//   (1) v2.0 stdole, (C:\WINDOWS\system32\StdOle2.tlb) 
// ************************************************************************ // 
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.  
{$WARN SYMBOL_PLATFORM OFF} 
{$WRITEABLECONST ON} 
{$VARPROPSETTER ON} 
interface 
 
uses Windows, ActiveX, Classes, Graphics, OleCtrls, 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 
  EDISONSMSGWLibMajorVersion = 1; 
  EDISONSMSGWLibMinorVersion = 0; 
 
  LIBID_EDISONSMSGWLib: TGUID = '{E69A8DCA-B4EE-4D71-938A-7652059D24B7}'; 
 
  DIID__DEdisonSmsGw: TGUID = '{A243F649-BC04-442A-8FEF-90B84E6F0B87}'; 
  DIID__DEdisonSmsGwEvents: TGUID = '{C017849C-06E3-4B6C-B5E2-7A5E9446A91F}'; 
  CLASS_EdisonSmsGw: TGUID = '{9B73BE22-7265-4F7E-8330-E09149049EF5}'; 
type 
 
// *********************************************************************// 
// Forward declaration of types defined in TypeLibrary                     
// *********************************************************************// 
  _DEdisonSmsGw = dispinterface; 
  _DEdisonSmsGwEvents = dispinterface; 
 
// *********************************************************************// 
// Declaration of CoClasses defined in Type Library                        
// (NOTE: Here we map each CoClass to its Default Interface)               
// *********************************************************************// 
  EdisonSmsGw = _DEdisonSmsGw; 
 
 
// *********************************************************************// 
// DispIntf:  _DEdisonSmsGw 
// Flags:     (4112) Hidden Dispatchable 
// GUID:      {A243F649-BC04-442A-8FEF-90B84E6F0B87} 
// *********************************************************************// 
  _DEdisonSmsGw = dispinterface 
    ['{A243F649-BC04-442A-8FEF-90B84E6F0B87}'] 
    function DisconnectModem: Integer; dispid 3; 
    function SendSms(const strPhoneNumber: WideString; const strSmsContent: WideString;  
                     nSmsIndex: Integer): Integer; dispid 4; 
    function SetRecvFlag(bRecvFlag: WordBool): Integer; dispid 6; 
    function IsConnecting: Integer; dispid 12; 
    function SetSendFlag(bSendFlag: WordBool): Integer; dispid 5; 
    function GetRecvFlag: WordBool; dispid 8; 
    function IsConnected: WordBool; dispid 9; 
    function ConnectModem(const strComName: WideString; nComRate: Integer; nSoftID: Integer): Integer; dispid 11; 
    function GetSendFlag: WordBool; dispid 7; 
    function IsFreeStatus: WordBool; dispid 10; 
    function GetCommRate: Integer; dispid 20; 
    function SetModemType(nType: Smallint): Integer; dispid 13; 
    procedure SetSmsServerNumber(const strNumber: WideString); dispid 14; 
    procedure SetSendRate(nSendFreeTime: Smallint); dispid 15; 
    function GetConnectComName: WideString; dispid 16; 
    function GetTaskCount: Integer; dispid 17; 
    function GetCommName: WideString; dispid 21; 
    function GetModemType: Integer; dispid 19; 
    procedure AboutBox; dispid -552; 
    function SendSignifySms(const strPhoneNumber: WideString; const strSmsContent: WideString;  
                            nSmsIndex: Integer): Integer; dispid 18; 
    function GetSendRate: Integer; dispid 22; 
    property ComRate: Integer dispid 2; 
    property PortNo: Integer dispid 1; 
  end; 
 
// *********************************************************************// 
// DispIntf:  _DEdisonSmsGwEvents 
// Flags:     (4096) Dispatchable 
// GUID:      {C017849C-06E3-4B6C-B5E2-7A5E9446A91F} 
// *********************************************************************// 
  _DEdisonSmsGwEvents = dispinterface 
    ['{C017849C-06E3-4B6C-B5E2-7A5E9446A91F}'] 
    procedure ConnectStatus(nStatus: Integer); dispid 1; 
    procedure SendSmsResult(nResult: Smallint; nIndex: Integer; const strPhoneNumber: WideString;  
                            const strSmsContent: WideString); dispid 2; 
    procedure Recvsms(const strPhoneNumber: WideString; const strSmsContent: WideString;  
                      nYear: Smallint; nMonth: Smallint; nDay: Smallint; nHour: Smallint;  
                      nMinute: Smallint; nSecond: Smallint); dispid 3; 
    procedure SendReport(const strSendNumber: WideString; const strSendTime: WideString;  
                         const strRecvTime: WideString); dispid 4; 
  end; 
 
 
// *********************************************************************// 
// OLE Control Proxy class declaration 
// Control Name     : TEdisonSmsGw 
// Help String      : EdisonSmsGw Control 
// Default Interface: _DEdisonSmsGw 
// Def. Intf. DISP? : Yes 
// Event   Interface: _DEdisonSmsGwEvents 
// TypeFlags        : (34) CanCreate Control 
// *********************************************************************// 
  TEdisonSmsGwConnectStatus = procedure(ASender: TObject; nStatus: Integer) of object; 
  TEdisonSmsGwSendSmsResult = procedure(ASender: TObject; nResult: Smallint; nIndex: Integer;  
                                                          const strPhoneNumber: WideString;  
                                                          const strSmsContent: WideString) of object; 
  TEdisonSmsGwRecvsms = procedure(ASender: TObject; const strPhoneNumber: WideString;  
                                                    const strSmsContent: WideString;  
                                                    nYear: Smallint; nMonth: Smallint;  
                                                    nDay: Smallint; nHour: Smallint;  
                                                    nMinute: Smallint; nSecond: Smallint) of object; 
  TEdisonSmsGwSendReport = procedure(ASender: TObject; const strSendNumber: WideString;  
                                                       const strSendTime: WideString;  
                                                       const strRecvTime: WideString) of object; 
 
  TEdisonSmsGw = class(TOleControl) 
  private 
    FOnConnectStatus: TEdisonSmsGwConnectStatus; 
    FOnSendSmsResult: TEdisonSmsGwSendSmsResult; 
    FOnRecvsms: TEdisonSmsGwRecvsms; 
    FOnSendReport: TEdisonSmsGwSendReport; 
    FIntf: _DEdisonSmsGw; 
    function  GetControlInterface: _DEdisonSmsGw; 
  protected 
    procedure CreateControl; 
    procedure InitControlData; override; 
  public 
    function DisconnectModem: Integer; 
    function SendSms(const strPhoneNumber: WideString; const strSmsContent: WideString;  
                     nSmsIndex: Integer): Integer; 
    function SetRecvFlag(bRecvFlag: WordBool): Integer; 
    function IsConnecting: Integer; 
    function SetSendFlag(bSendFlag: WordBool): Integer; 
    function GetRecvFlag: WordBool; 
    function IsConnected: WordBool; 
    function ConnectModem(const strComName: WideString; nComRate: Integer; nSoftID: Integer): Integer; 
    function GetSendFlag: WordBool; 
    function IsFreeStatus: WordBool; 
    function GetCommRate: Integer; 
    function SetModemType(nType: Smallint): Integer; 
    procedure SetSmsServerNumber(const strNumber: WideString); 
    procedure SetSendRate(nSendFreeTime: Smallint); 
    function GetConnectComName: WideString; 
    function GetTaskCount: Integer; 
    function GetCommName: WideString; 
    function GetModemType: Integer; 
    procedure AboutBox; 
    function SendSignifySms(const strPhoneNumber: WideString; const strSmsContent: WideString;  
                            nSmsIndex: Integer): Integer; 
    function GetSendRate: Integer; 
    property  ControlInterface: _DEdisonSmsGw read GetControlInterface; 
    property  DefaultInterface: _DEdisonSmsGw read GetControlInterface; 
  published 
    property Anchors; 
    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 ComRate: Integer index 2 read GetIntegerProp write SetIntegerProp stored False; 
    property PortNo: Integer index 1 read GetIntegerProp write SetIntegerProp stored False; 
    property OnConnectStatus: TEdisonSmsGwConnectStatus read FOnConnectStatus write FOnConnectStatus; 
    property OnSendSmsResult: TEdisonSmsGwSendSmsResult read FOnSendSmsResult write FOnSendSmsResult; 
    property OnRecvsms: TEdisonSmsGwRecvsms read FOnRecvsms write FOnRecvsms; 
    property OnSendReport: TEdisonSmsGwSendReport read FOnSendReport write FOnSendReport; 
  end; 
 
procedure Register; 
 
resourcestring 
  dtlServerPage = 'ActiveX'; 
 
  dtlOcxPage = 'ActiveX'; 
 
implementation 
 
uses ComObj; 
 
procedure TEdisonSmsGw.InitControlData; 
const 
  CEventDispIDs: array [0..3] of DWORD = ( 
    $00000001, $00000002, $00000003, $00000004); 
  CControlData: TControlData2 = ( 
    ClassID: '{9B73BE22-7265-4F7E-8330-E09149049EF5}'; 
    EventIID: '{C017849C-06E3-4B6C-B5E2-7A5E9446A91F}'; 
    EventCount: 4; 
    EventDispIDs: @CEventDispIDs; 
    LicenseKey: nil (*HR:$80004005*); 
    Flags: $00000000; 
    Version: 401); 
begin 
  ControlData := @CControlData; 
  TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnConnectStatus) - Cardinal(Self); 
end; 
 
procedure TEdisonSmsGw.CreateControl; 
 
  procedure DoCreate; 
  begin 
    FIntf := IUnknown(OleObject) as _DEdisonSmsGw; 
  end; 
 
begin 
  if FIntf = nil then DoCreate; 
end; 
 
function TEdisonSmsGw.GetControlInterface: _DEdisonSmsGw; 
begin 
  CreateControl; 
  Result := FIntf; 
end; 
 
function TEdisonSmsGw.DisconnectModem: Integer; 
begin 
  Result := DefaultInterface.DisconnectModem; 
end; 
 
function TEdisonSmsGw.SendSms(const strPhoneNumber: WideString; const strSmsContent: WideString;  
                              nSmsIndex: Integer): Integer; 
begin 
  Result := DefaultInterface.SendSms(strPhoneNumber, strSmsContent, nSmsIndex); 
end; 
 
function TEdisonSmsGw.SetRecvFlag(bRecvFlag: WordBool): Integer; 
begin 
  Result := DefaultInterface.SetRecvFlag(bRecvFlag); 
end; 
 
function TEdisonSmsGw.IsConnecting: Integer; 
begin 
  Result := DefaultInterface.IsConnecting; 
end; 
 
function TEdisonSmsGw.SetSendFlag(bSendFlag: WordBool): Integer; 
begin 
  Result := DefaultInterface.SetSendFlag(bSendFlag); 
end; 
 
function TEdisonSmsGw.GetRecvFlag: WordBool; 
begin 
  Result := DefaultInterface.GetRecvFlag; 
end; 
 
function TEdisonSmsGw.IsConnected: WordBool; 
begin 
  Result := DefaultInterface.IsConnected; 
end; 
 
function TEdisonSmsGw.ConnectModem(const strComName: WideString; nComRate: Integer; nSoftID: Integer): Integer; 
begin 
  Result := DefaultInterface.ConnectModem(strComName, nComRate, nSoftID); 
end; 
 
function TEdisonSmsGw.GetSendFlag: WordBool; 
begin 
  Result := DefaultInterface.GetSendFlag; 
end; 
 
function TEdisonSmsGw.IsFreeStatus: WordBool; 
begin 
  Result := DefaultInterface.IsFreeStatus; 
end; 
 
function TEdisonSmsGw.GetCommRate: Integer; 
begin 
  Result := DefaultInterface.GetCommRate; 
end; 
 
function TEdisonSmsGw.SetModemType(nType: Smallint): Integer; 
begin 
  Result := DefaultInterface.SetModemType(nType); 
end; 
 
procedure TEdisonSmsGw.SetSmsServerNumber(const strNumber: WideString); 
begin 
  DefaultInterface.SetSmsServerNumber(strNumber); 
end; 
 
procedure TEdisonSmsGw.SetSendRate(nSendFreeTime: Smallint); 
begin 
  DefaultInterface.SetSendRate(nSendFreeTime); 
end; 
 
function TEdisonSmsGw.GetConnectComName: WideString; 
begin 
  Result := DefaultInterface.GetConnectComName; 
end; 
 
function TEdisonSmsGw.GetTaskCount: Integer; 
begin 
  Result := DefaultInterface.GetTaskCount; 
end; 
 
function TEdisonSmsGw.GetCommName: WideString; 
begin 
  Result := DefaultInterface.GetCommName; 
end; 
 
function TEdisonSmsGw.GetModemType: Integer; 
begin 
  Result := DefaultInterface.GetModemType; 
end; 
 
procedure TEdisonSmsGw.AboutBox; 
begin 
  DefaultInterface.AboutBox; 
end; 
 
function TEdisonSmsGw.SendSignifySms(const strPhoneNumber: WideString;  
                                     const strSmsContent: WideString; nSmsIndex: Integer): Integer; 
begin 
  Result := DefaultInterface.SendSignifySms(strPhoneNumber, strSmsContent, nSmsIndex); 
end; 
 
function TEdisonSmsGw.GetSendRate: Integer; 
begin 
  Result := DefaultInterface.GetSendRate; 
end; 
 
procedure Register; 
begin 
  RegisterComponents(dtlOcxPage, [TEdisonSmsGw]); 
end; 
 
end.