Discuss this help topic in MsgConnect Forum

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



Messenger.GetMessageSource

Messenger     See also    


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

Declaration

[C++]
    void GetMessageSource(MCMessage* Message, char* Buffer, int* BufferSize);

[Pascal]
    function GetMessageSource(var Message : TMCMessage) : string;

[VB6]
    Function GetMessageSource(Message As IMCXMessage) As String

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

[C#]
    public string GetMessageSource(ref MCMessage Message)

[VB.NET]
    Public Function GetMessageSource(ByRef Message As MCMessage) As String

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

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

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

Parameters

  • [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.

Description

    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