Discuss this help topic in MsgConnect Forum

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



Messenger.SendMessage

Messenger     See also    


Sends a message to the recipient and wait for result.

Declaration

[C++]
    long SendMessage(char* Destination, MCMessage* Message, MCMessageCredentials* Credentials);

[Pascal]
    function SendMessage(Destination : string; var Message : TMCMessage; Credentials : PMCMessageCredentials) : integer;

[VB6]
    Function SendMessage(Destination As String, Message As IMCXMessage, Credentials As MCXMessageCredentials) As Long

[ActiveX]
    HRESULT _stdcall SendMessage([in] BSTR Destination, [in] IMCXMessage * Message, [in] IMCXMessageCredentials * Credentials, [out, retval] VARIANT_BOOL * res);

[C#]
    public int SendMessage(string Destination, MCMessage Message, MCMessageCredentials —redentials);

[VB.NET]
    Public Function SendMessage(ByVal Destination As String, ByRef Message As MCMessage, ByVal Credentials As MCMessageCredentials) As Integer

[Java]
    public int sendMessage(String destination, final MCMessage message, MCMessageCredentials credentials);

[Java ME]
    public int sendMessage(String destination, final MCMessage message, MCMessageCredentials credentials);

[DLL]
    long __stdcall MCMessengerSendMessage(HMCMessenger h, char* Destination, MCMessage* Message, MCMessageCredentials* Credentials, long* res);

Parameters

  • [DLL]h - handle to the Messenger object that was returned by Create method

  • Destination - The address of the message recipient. See more here
  • Message - The message to be sent. See more here
  • Credentials - (optional) Credentials to be set for the message. Can be set to null (nil) if credentials system is not used. See more here
  • [DLL, ActiveX]res - result of method execution (see Result for details)

Return value

    Return value is true if the message was sent successfully or false if timeout has expired.
[DLL]
    MC_OK is always returned.

Description

    Call this method to send the message to some other messenger and wait for reply from the recipient. Wait operation lasts infinitely (in fact, waiting is stopped after time specified by MaxTimeout property elapses). Destination specifies the address of the recipient. This method determines the right transport to use and passes the message to the transport. If the transport was not found or the request didn't reach the recipient for some reason, an exception is raised. [DLL] Error is determined by return value.
For information about error and timeout handling see Error and Timeout Handling topic.

Discuss this help topic in MsgConnect Forum