IRTCSession::SendMessage

The SendMessage method sends an instant message. For this method to succeed, the session must be of type RTCST_IM or RTCST_MULTIPARTY_IM.

The completion is notified with an RTCE_MESSAGING event of type RTCMSET_MESSAGE.

HRESULT SendMessage(BSTRbstrMessageHeader,
BSTRbstrMessage,
LONG_PTRlCookie);

Parameters

  • bstrMessageHeader
    [in] MIME header. This is the content type of the message to be sent. CR and LF characters are not allowed in this string.
  • bstrMessage
    [in] The message that is sent.
  • lCookie
    [in] Application-provided value used as an identification number for this message. This value is later used to pair the received notification with its corresponding message.

Return Values

RTC methods may return an RTC_E_ constant.

Value Meaning
RTC_E_INVALID_SESSION_STATE The message state must be RTCSS_INPROGRESS, RTCSS_INCOMING, or RTCSS_CONNECTED.
RTC_E_INVALID_SESSION_TYPE The session must be IM.

Remarks

This function may send data over the wire in unencrypted form; therefore, someone eavesdropping on the network may be able to read the data. The security risk of sending the data in clear text should be considered before using this method in an unencrypted session. An RTC session can be encrypted by specifying TLS in the profile used for the session.

Requirements

Client: Requires Windows XP.
Server: Requires Windows Server 2003.
Redistributable: Requires Rtcdll.dll on Windows 2000, and Windows Me/98.
Header: Declared in Rtccore.h.
Library: Included as a resource in Rtcdll.dll.
GUID: IID_IRTCSession is defined as 387c8086-99be-42fb-9973-7c0fc0ca9fa8.

See Also

IRTCSession, IRTCSession::SendMessageStatus, Create an IM Session