Home > Back-end >  How to response to a COM interface events in DELPHI?
How to response to a COM interface events in DELPHI?

Time:09-25

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//Interface: Iemptcl
//Flags: (4416) Dual OleAutomation Dispatchable
//GUID: {2383647 b8b AC50-251 - a - 6772-4 b3d8f01e3}
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
Iemptcl=interface (IDispatch)
[' {2383647 b8b AC50-251 - a - 6772-4 b3d8f01e3} ']
The function connect (const IPAddr: WideString; Port: Integer;
Const bstrAccountID: WideString; Const bstrPassword: WideString)
: ConnectResultEnum; Safecall;
Procedure disconnect; Safecall;
The function Get_connected: WordBool; Safecall;
Procedure submit (const Msg: IShortMessage); Safecall;
The function Get_AccountID: WideString; Safecall;
Procedure Set_AccountID (const pVal: WideString); Safecall;
The function Get_signature: WideString; Safecall;
Procedure Set_signature (const pVal: WideString); Safecall;
The function Get_MsgID: WideString; Safecall;
The function Get_SequenceID: WideString; Safecall;
The function Get_needStatus: WordBool; Safecall;
Procedure Set_needStatus (pVal: WordBool); Safecall;
Procedure submit_LongMsg (const Msg: IShortMessage; Speed: SYSINT); Safecall;
The property connected: WordBool read Get_connected;
The property AccountID: WideString read Get_AccountID write Set_AccountID;
The property signature: WideString read Get_signature write Set_signature;
The property MsgID: WideString read Get_MsgID;
The property SequenceID: WideString read Get_SequenceID;
The property needStatus: WordBool read Get_needStatus write Set_needStatus;
end;


//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//DispIntf: _IemptclEvents
//Flags: (4096) Dispatchable
//GUID: {C4380BFC df7 - B937-01-9918-4 ecc5e94e2d}
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
_IemptclEvents=dispinterface
[' {C4380BFC df7 - B937-01-9918-4 ecc5e94e2d} ']
The function MessageReceived (const MsgID: WideString; Const srcID: WideString;
Const content: WideString; SubmitDatetime: OleVariant) : HResult; Dispid 1;
The function MessageReceivedInterface (const sm: ISMDeliverd) : HResult; Dispid 2;
The function StatusReceived (const MsgID: WideString; Const DestID: WideString;
DoneDatetime: OleVariant) : HResult; Dispid 3;
The function StatusReceivedInterface (const sm: IStatusReport) : HResult;
Dispid 4;
The function SubmitResp (const MsgID: WideString; Result: Integer;
SequenceID: Integer) : HResult; Dispid 5;
The function SubmitRespInterface (const sm: ISubmitResp) : HResult; Dispid 6;
The function EMPPClosed (errorCode: Integer) : HResult; Dispid 7;
The function SocketClosed (errorCode: Integer) : HResult; Dispid 8;
The function EMPPConnected: HResult; Dispid 9;
end;


Description:
The above interface is China mobile SMS platform provides interfaces, the following is the interface trigger events,
I'm going to respond to events, for example, how to respond to the following event interface of EMPPConnected
Response code like this:
The function EMPPConnected: HResult;
The begin
Showmessage (' connection is successful, ');
end;

CodePudding user response:

You write a first class by the interface;
Create a moment, then to the callback function assignment, you can call to another if you have to connect the hardware detection hardware status,

CodePudding user response:

Can provide your email address? I put the question to your email,

CodePudding user response:

Reply xqchenxue2:

_IemptclEvents is an event, the third party DLL is implemented well, I have to do now is how to respond to this event,

CodePudding user response:

1044231471 @qq.com

CodePudding user response:

Can't control the source file in an OLE control
  • Related