Discuss this help topic in MsgConnect Forum

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


Messenger     See also    

Returns the transport name and the address of the Messenger that sent a message.


    void GetMessageSource(MCMessage* Message, char* Buffer, int* BufferSize);

    function GetMessageSource(var Message : TMCMessage) : string;

    Function GetMessageSource(Message As IMCXMessage) As String

    HRESULT _stdcall GetMessageSource([in, out] IMCXMessage ** Message, [out, retval] BSTR * Source );

    public string GetMessageSource(ref MCMessage Message)

    Public Function GetMessageSource(ByRef Message As MCMessage) As String

    public String getMessageSource(final MCMessage message);

[Java ME]
    public synchronized String getMessageSource(final MCMessage message);

    long __stdcall MCMessengerGetMessageSource(HMCMessenger h, MCMessage* Message, char* Buffer, int* BufferSize);


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

  • Buffer - The buffer into which the method will place the resulting value. The buffer must be large enough to hold all data (practically, we recommend 150 bytes for now). If you want to get the necessary size, pass NULL.
  • BufferSize - When calling the method, this parameter contains the size of the buffer. When the method returns and NULL was passed as Buffer, BufferSize will contain the necessary size for the buffer. When the method returns and the buffer was passed, BufferSize contains the number of characters copied excluding terminating NULL.
    Do NOT pass the small buffer, -- the method doesn't perform length checking when it copies the result.
  • Message - Reference to the message whose source is being queried. See more here

Return value

    The text that contains the part of the sender's address -- transport name and source address specific to the transport.


    Call this method to get the address of the message sender. As described in Message Addressing, the address constists of Transport identifier, destination address and Queue name. GetMessageSource function returns transport identifier and destination address. This method is useful when you need to send a separate message to the sender of originating message.

    Note: the address part of the result returned by GetMessageSource is specific to the transport and it can be not an address, but certain internal ID suitable for sending a message.

See also:     MCMessage structure    

Discuss this help topic in MsgConnect Forum