Discuss this help topic in MsgConnect Forum

Filter: C++  Pascal  C#  VB.NET  Java  Java ME  ActiveX  DLL 



Messenger.CancelMessageEx

Messenger     See also    


Deletes the message from the outgoing or complete message queues.

Declaration

[C++]
    bool CancelMessageEx(__int64 MsgID, bool CancelComplete);

[Pascal]
    function CancelMessageEx(MsgID : Int64; CancelComplete : boolean): Boolean;

[VB6]
    Function IMCXMessenger3.CancelMessageEx(MsgID As String, CancelComplete As Boolean) As Boolean

[ActiveX]
    HRESULT _stdcall IMCXMessenger3.CancelMessageEx([in] BSTR MsgID, [in] VARIANT_BOOL CancelComplete, [out, retval] VARIANT_BOOL * res);

[C#]
    public bool CancelMessageEx(long MsgID, bool CancelComplete);

[VB.NET]
    Public Function CancelMessageEx(ByVal MsgID As Long, ByVal CancelComplete As Boolean) As Boolean

[Java]
    public synchronized boolean cancelMessageEx(long MsgID, boolean CancelComplete);

[Java ME]
    public synchronized boolean cancelMessageEx(long MsgID, boolean CancelComplete);

[DLL]
    bool CancelMessageEx(HMCMessenger h, __int64 MsgID, bool CancelComplete)

Parameters

  • [DLL]h - handle to the Messenger object that was returned by Create method
  • MsgID - MsgID value of the message you want to delete.
  • CancelComplete - This parameter defines if the queue of complete messages is to be searched for the message.
  • res - result of method execution (see Return value for details)

Return value

True if message was successfully deleted.
False if message was not deleted.
[ActiveX]
    Return value is passed via Result parameter.

Description

    This method can be useful after calling SendMessageCallback or SendMessageTimeoutCallback methods. CancelMessageEx tries to delete the message from outgoing queue and, if CancelComplete parameter is true, from the queue of complete messages.
    To choose the message you want to delete from queue use MsgID value of the MCMessage structure.
    This method lets you cancel not only the message pending for delivery, but also already complete message. Of course, this doesn't mean that the message is returned back. Cancelling a message lets you avoid getting a notification via callback method that in other case would be called.

Discuss this help topic in MsgConnect Forum