Share via


IRTCSession::SendMessage

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This method sends an instant message. The session must be of type RTCST_IM or RTCST_MULTIPARTY_IM.

Syntax

HRESULT SendMessage(
  BSTR bstrMessageHeader,
  BSTR bstrMessage,
  LONG_PTR lCookie
);

Parameters

  • bstrMessageHeader
    [in] The MIME header for the message.

    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] Pointer to an application-provided value used as an identification number for the message.

    This value is later used to pair the received notification with the message.

    See the Remarks section.

Return Value

This method can return an RTC_E_ constant.

The following table shows additional information about specific return values.

Value Description

RTC_E_INVALID_SESSION_STATE

Message state must be RTCSS_INPROGRESS, RTCSS_INCOMING, or RTCSS_CONNECTED.

RTC_E_INVALID_SESSION_TYPE

Session must be of type RTCST_IM.

Remarks

Completion is notified with an RTCE_MESSAGING event of type RTCMSET_MESSAGE.

Aa926578.security(en-us,MSDN.10).gifSecurity Note:
This method can send data over the network in unencrypted form. Therefore, someone eavesdropping on the network might be able to read the data. Before using this method in an unencrypted session, consider the security risk of sending the data in clear text. The application can encrypt an RTC session by specifying TLS in the profile used for the session.

Requirements

Header rtccore.h, rtccore.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

IRTCSession
IRTCSession::SendMessageStatus