EldoS
MsgConnect home / Documentation / Messenger.SendMessage method
Navigation
Web site
Support
Table Of Contents

Filter: C++  Pascal  ActiveX  C#  VB.NET  Java SE  Java ME  Palm  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);

[Palm]
    long SendMessage(char* Destination, 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]
    If the function was called not from the same thread in which Messenger operates, MCE_WRONGTHREAD code is returned, if there was no transport found MCE_NOTRANSPORT is returned, otherwise MC_OK is 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.

See also:     Queue class     MCMessage structure     MessageCredentials structure     Addressing     MaxTimeout property     PostMessage     SendMessageTimeout     SendMessageCallback     SendMessageTimeoutCallback    

 
Contact Us | Subscribe | Terms of Use | Trademarks | Privacy Statement
Copyright (c) 1998-2005, EldoS Corporation