Public Member Functions | |
| HRESULT | Clear (void) |
| HRESULT | AddMsg ([in] IDispatch *pRdNtChatMsg) |
| HRESULT | GetNumMsgs (RtDWORD *pdwNumMsgs) |
| HRESULT | GetMsg (RtDWORD dwMsgNum, IDispatch **ppRdNtChatMsg) |
Properties | |
| RtDWORD * | MaxNumOfMsgs [get] |
| RtDWORD | MaxNumOfMsgs [set] |
Example: This example demonstrates usage of IRdNtChatDisp and IRdNtChatMsg objects. The code below create its own RdNtChat object, but you can read the one stored in Chat connector too.
// Create chat message and fill it with a data RdNtChatMsg = System.CreateDO("Network Package/Net Chat Msg Data"); RdNtChatMsg.ClientName = 'tester'; RdNtChatMsg.Text = 'This is a text'; // Create chat object and add the chat message into it. RdNtChat = System.CreateDO("Network Package/Net Chat Data"); RdNtChat.AddMsg(RdNtChatMsg); // Now enumerate all messages in RdNtChat object and show them in debug view. dwNumMsgs = RdNtChat.GetNumMsgs(); for (ind = 0; ind < dwNumMsgs; ind++) { RdNtChatMsg = RdNtChat.GetMsg(ind); bstrLine = RdNtChatMsg.ClientName() + ': ' + RdNtChatMsg.Text() + '\n'; System.Trace(bstrLine); }
| HRESULT IRdNtChatDisp::Clear | ( | void | ) |
Delete all the chat messages.
RdNtChat.Clear();
| HRESULT IRdNtChatDisp::AddMsg | ( | [in] IDispatch * | pRdNtChatMsg | ) |
Add new message.
| pRdNtChatMsg | [in] New chat message IRdNtChatMsg object. |
RdNtChat = System.CreateDO("Network Package/Net Chat Data");
RdNtChat.AddMsg(RdNtChatMsg);
| HRESULT IRdNtChatDisp::GetNumMsgs | ( | RtDWORD * | pdwNumMsgs | ) |
Get number of stored messages
dwNumMsgs = RdNtChat.GetNumMsgs();
| HRESULT IRdNtChatDisp::GetMsg | ( | RtDWORD | dwMsgNum, | |
| IDispatch ** | ppRdNtChatMsg | |||
| ) |
Get message with specified index.
| dwMsgNum | [in] Index of the message you want to read. |
for (ind = 0; ind < dwNumMsgs; ind++) { RdNtChatMsg = RdNtChat.GetMsg(ind); bstrLine = RdNtChatMsg.ClientName() + ': ' + RdNtChatMsg.Text() + '\n'; System.Trace(bstrLine); }
RtDWORD * IRdNtChatDisp::MaxNumOfMsgs [get] |
Read maximum number of stored chat messages in this object.
maxMessages = RdNtChat.MaxNumOfMsgs();
RtDWORD IRdNtChatDisp::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.
RdNtChat.MaxNumOfMsgs() = 50;
1.5.5