// *********************************************************************//
  // Interface: Iemptcl
  // Flags:     (4416) Dual OleAutomation Dispatchable
  // GUID:      {2383647A-6772-4B8B-AC50-251B3D8F01E3}
  // *********************************************************************//
  Iemptcl = interface(IDispatch)
    ['{2383647A-6772-4B8B-AC50-251B3D8F01E3}']
    function connect(const IPAddr: WideString; Port: Integer;
      const bstrAccountID: WideString; const bstrPassword: WideString)
      : ConnectResultEnum; safecall;
    procedure disconnect; safecall;
    function Get_connected: WordBool; safecall;
    procedure submit(const Msg: IShortMessage); safecall;
    function Get_AccountID: WideString; safecall;
    procedure Set_AccountID(const pVal: WideString); safecall;
    function Get_signature: WideString; safecall;
    procedure Set_signature(const pVal: WideString); safecall;
    function Get_MsgID: WideString; safecall;
    function Get_SequenceID: WideString; safecall;
    function Get_needStatus: WordBool; safecall;
    procedure Set_needStatus(pVal: WordBool); safecall;
    procedure submit_LongMsg(const Msg: IShortMessage; speed: SYSINT); safecall;
    property connected: WordBool read Get_connected;
    property AccountID: WideString read Get_AccountID write Set_AccountID;
    property signature: WideString read Get_signature write Set_signature;
    property MsgID: WideString read Get_MsgID;
    property SequenceID: WideString read Get_SequenceID;
    property needStatus: WordBool read Get_needStatus write Set_needStatus;
  end;
// *********************************************************************//
  // DispIntf:  _IemptclEvents
  // Flags:     (4096) Dispatchable
  // GUID:      {C4380BFC-9918-4DF7-B937-01ECC5E94E2D}
  // *********************************************************************//
  _IemptclEvents = dispinterface
    ['{C4380BFC-9918-4DF7-B937-01ECC5E94E2D}']
    function MessageReceived(const MsgID: WideString; const srcID: WideString;
      const content: WideString; submitDatetime: OleVariant): HResult; dispid 1;
    function MessageReceivedInterface(const sm: ISMDeliverd): HResult; dispid 2;
    function StatusReceived(const MsgID: WideString; const DestID: WideString;
      doneDatetime: OleVariant): HResult; dispid 3;
    function StatusReceivedInterface(const sm: IStatusReport): HResult;
      dispid 4;
    function SubmitResp(const MsgID: WideString; Result: Integer;
      SequenceID: Integer): HResult; dispid 5;
    function SubmitRespInterface(const sm: ISubmitResp): HResult; dispid 6;
    function EMPPClosed(errorCode: Integer): HResult; dispid 7;
    function SocketClosed(errorCode: Integer): HResult; dispid 8;
    function EMPPConnected: HResult; dispid 9;
  end;
说明:
   上面的接口是中国移动短信平台提供的接口,下面则是该接口的触发事件。
   我现在要响应事件,比如说,如何响应下面事件接口中的EMPPConnected
  响应的代码类似于这样的:
  function EMPPConnected:HResult;
  begin
     showmessage('连接成功了。');
  end;

解决方案 »

  1.   

    你先写个类实其接口;
    然后create一下,再给其回调函数赋值,就可以调用到了,另外如果有要连硬件的话,还要检测硬件状态。
      

  2.   

    回复 xqchenxue2:_IemptclEvents 是一个事件,第三方的DLL已经实现好了,我现在要做的是如何响应这个事件。
      

  3.   

    难道控制源文件里没有一个OLE控件