# IRdNtChat Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | Clear (void)
HRESULT | AddMsg ([in] IRdNtChatMsg *pRdNtChatMsg)
HRESULT | GetNumMsgs ([out, retval] RtDWORD *pdwNumMsgs)
HRESULT | GetMsg (RtDWORD dwMsgNum, IRdNtChatMsg **ppRdNtChatMsg)
## Properties
RtDWORD * | MaxNumOfMsgs`[get]`
RtDWORD | MaxNumOfMsgs`[set]`

## Detailed Description

This object stores all the chat messages.
It is generated for example by client object into Chat connector (see IRiNetwork::NtConnectTo) that you can find in /Network space after you enter into a Shared Space.

See also:
  IRdNtChatDisp, IRdNtChatMsg

## Member Function Documentation

HRESULT IRdNtChat::Clear | ( | void |  | ) |

Delete all the chat messages.

        RdNtChat.Clear();

HRESULT IRdNtChat::AddMsg | ( | [in] IRdNtChatMsg * | pRdNtChatMsg | ) |

Add new message.

Parameters:

  | pRdNtChatMsg | [in] New chat message IRdNtChatMsg object.

        RdNtChat = System.CreateDO("Network Package/Net Chat Data");
        RdNtChat.AddMsg(RdNtChatMsg);

HRESULT IRdNtChat::GetNumMsgs | ( | [out, retval] RtDWORD * | pdwNumMsgs | ) |

Get number of stored messages

Returns:
  pdwNumMsgs [out, retval] Returns number of stored messages.

        dwNumMsgs = RdNtChat.GetNumMsgs();

HRESULT IRdNtChat::GetMsg | ( | RtDWORD | dwMsgNum,
|  | IRdNtChatMsg ** | ppRdNtChatMsg |
| ) |  |  |

Get message with specified index.

Parameters:

  | dwMsgNum | [in] Index of the message you want to read.

Returns:
  ppRdNtChatMsg [out, retval] returned IRdNtChatMsg message object.

        for (ind = 0; ind < dwNumMsgs; ind++)
        {
            RdNtChatMsg = RdNtChat.GetMsg(ind);
            bstrLine = RdNtChatMsg.ClientName() + ': ' + RdNtChatMsg.Text() + '\n';
            System.Trace(bstrLine);
        }

## Property Documentation

RtDWORD * IRdNtChat::MaxNumOfMsgs`[get]`

Read maximum number of stored chat messages in this object.

Returns:
  pdwMaxNum [out, retval] Number of the messages.

     maxMessages = RdNtChat.MaxNumOfMsgs();

RtDWORD IRdNtChat::MaxNumOfMsgs`[set]`

Set maximum number of stored messages. The default value is 100.
If new message is added and object already storing the maximum number of messages,
then the last one is removed and all other messages are shifted.

Returns:
  pdwMaxNum [out, retval] The maximum number of stored messages.

     RdNtChat.MaxNumOfMsgs() = 50;