This section describes the events associated with the MsChatPr object.
Fires when entering a channel or when a new member joins an open channel.
object_OnAddMember(Channel, Nickname, MemberItems)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. Nickname Required. A string expression that contains the user's Nickname. MemberItems Required. An object expression that evaluates to a ChatItems object.
When entering a channel, the control user receives the initial member list through OnAddMember events. One OnAddMember event also occurs for each incoming new member.
To determine the valid MemberItems of the object, use the ValidItems property.
Fires at the beginning of an enumeration, when entering a channel or listing users, members, or channels.
object_OnBeginEnumeration(Channel, EnumType)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. EnumType Required. A variable of enumEnumType type.
Fires when an asynchronous error related to a channel occurs.
object_OnChannelError(Channel, ErrorCode, Description)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. ErrorCode Required. A long integer value that indicates the channel error code. Description Required. A string expression that contains the description of the error.
Fires after a ListChannels or QueryChannelProperty call.
object_OnChannelProperty(Channel, ChannelItems)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. ChannelItems Required. An object expression that evaluates to a ChatItems object.
This event can also be fired after a time-out occurs while accessing a ChannelProperty property.
To determine the valid ChannelItems of the object, use ValidItems property.
Fires when a channel property changes, such as after calling ChangeChannelProperty.
object_OnChannelPropertyChanged(Channel, ModifierNickname, ChannelPropertyName, OldChannelProperty, NewChannelProperty)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. ModifierNickname Required. A string expression containing the modifier nickname. ChannelPropertyName Required. A string expression containing the name of the channel property that changed. OldChannelProperty Required. A variant, the type of which depends on the old channel property. NewChannelProperty Required. A variant, the type of which depends on the new channel property.
Fires after a CreateChannel, JoinChannel, or LeaveChannel call or after an asynchronous event, such as being kicked out of the room or being disconnected.
object_OnChannelState(Channel, NewChannelState)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. NewChannelState Required. A short integer of enumChannelState type.
Fires when an asynchronous error occurs.
object_OnConnectionError(ErrorCode, Description, ChannelName)
Part Description object Required. An object expression that evaluates to an MsChatPr control. ErrorCode Required. A long integer containing the value of the error code. Description Required. A string expression containing the description of the error code. ChannelName Required. A variant, the type of which depends on the name of the channel.
Fires after Connect, Login, CancelConnectLogin, and Disconnect calls or when an asynchronous disconnection occurs.
object_OnConnectionState(NewConnectionState)
Part Description object Required. An object expression that evaluates to an MsChatPr control. NewConnectionState Required. A variable of enumConnectionState type.
Dim NewConnectionState As enumConnectionState NewConnectionState = MsChatPr1.ConnectionState
Fires when a member leaves an open channel or is kicked out of the channel.
object_OnDelMember(Channel, Nickname)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. Nickname Required. A string expression that contains the Nickname of the user who is leaving the channel.
Fires at the end of an enumeration, when entering a channel or listing users, members, or channels.
object_OnEndEnumeration(Channel, EnumType)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. EnumType Required. A variable of enumEnumType type.
Fires when the control user is invited to a channel.
object_OnInvitation(ChannelName, InviterItems)
Part Description object Required. An object expression that evaluates to an MsChatPr control. ChannelName Required. A string expression that represents the channel to which the user is invited. InviterItems Required. An object expression that evaluates to a ChatItems object. Gives all the known information about the user who is performing the inviting.
To determine the valid InviterItems of the object, use ValidItems property.
Fires when a user failed to enter a channel.
object_OnKnock(Channel, KnockerItems, ErrorCode)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. KnockerItems Required. An object expression that evaluates to a ChatItems object. ErrorCode Required. A long integer value that indicates why the user could not join the channel. Examples are that the channel is full, the channel is invite-only, or a channel Keyword is set.
Only the hosts of the channel receive this notification. Also, the notification occurs only if the cmKnock flag is set for that channel.
To determine the valid KnockerItems of the object, use ValidItems property.
Fires when a member is kicked out of the channel.
object_OnMemberKicked(Channel, KickedNickname, KickerNickname, Reason)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. KickedNickname Required. A string expression containing the Nickname of the member who is being kicked. KickerNickname Required. A string expression containing the Nickname of the member who is doing the kicking. Reason Required. A string expression containing the reason the member is being kicked, or it can be empty.
This event can result from a KickMember method call and is immediately followed by an OnDelMember event.
Fires after a ListMembers or QueryMemberProperty call.
object_OnMemberProperty(Channel, MemberItems)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. MemberItems Required. An object expression that evaluates to a ChatItems object.
This event can also be fired after a time-out occurs while accessing the MemberProperty property.
To determine the valid MemberItems of the object, use the ValidItems property.
Fires when a member property changes, such as after a ChangeMemberProperty or ChangeNickname call.
object_OnMemberPropertyChanged(Channel, ModifiedNickname, ModifierNickname, MemberPropertyName, OldMemberProperty, NewMemberProperty)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. ModifiedNickname Required. A string expression containing the Nickname of the member that is being modified. ModifierNickname Required. A string expression containing the Nickname of the modifier. MemberPropertyName Required. A string containing a valid member property name value. Can be Modes or Nickname. OldMemberProperty Required. A variant, the data type of which is dependent on the old member property. NewMemberProperty Required. A variant, the data type of which is dependent on the new member property.
Fires when a member sends a message to the channel or members of the channel including the control user.
object_OnMessage(Channel, SenderNickname, MessageType, Message, RecipientNicknames, DataMessageTag)
Part Description object Required. An object expression that evaluates to an MsChatPr control. Channel Required. An object expression that evaluates to a Channel object. SenderNickname Required. A string expression that contains the Nickname of the sender. MessageType Required. A long integer of enumMessageType type. Message Required. A variant. When the data message is received and the msgtDataRaw flag is not set, the Message parameter can be a number, a string, an array of numbers, an array of strings, or an array of variants that are strings or numbers. This is exactly like the Message parameter used in the SendMessage method. However, when the msgtDataRaw flag is set, the Message parameter is an array of these three variants:
Message[0] The postprocessed string that represents the array of bytes received. Message[1] An array of bytes. Message[2] An array of variants that are bytes. RecipientNicknames Required. An array of variants that are strings when the incoming message is a whisper (that is, that originates from the SendMessage call that uses the msgtWhisper type). RecipientNicknames is a string containing the user's nickname when the message is a multicasted data message (that is, a data message that was sent to one or more channel members including the control user). This differentiates the data messages that were sent to the channel where RecipientNicknames is an empty variant and those that were sent to channel member(s). RecipientNicknames is an empty variant in all other cases.
DataMessageTag Required. A variant. Empty when the Message parameter is a string, and must be a string expression when Message is data.
Fires when a user sends a private message to the control user.
object_OnPrivateMessage(SenderNickname, PrivateMessageType, Message, DataMessageTag)
Part Description object Required. An object expression that evaluates to an MsChatPr control. SenderNickname Required. A string expression containing the Nickname of the sender. PrivateMessageType Required. A long integer. Message Required. A variant. When a data message is received and the pmtDataRaw flag is not set, the Message parameter can be a number, a string, an array of numbers, an array of strings, or an array of variants that are strings or numbers. This is exactly like the Message parameter used in the SendPrivateMessage method. However, when the pmtDataRaw flag is set, the Message parameter is an array of these three variants:
Message[0] The postprocessed string that represents the array of bytes received. Message[1] An array of bytes. Message[2] An array of variants that are bytes. DataMessageTag Required. A variant. This parameter is empty when the Message parameter is a string, and is a string when Message is data.
Fires for any incoming server message when the ProcessProtocolMessages property is set to FALSE.
object_OnProtocolMessage(MessagePrefix, MessageCommand, MessageParameters, EnableDefault)
Part Description object Required. An object expression that evaluates to an MsChatPr control. MessagePrefix Required. A string expression. MessageCommand Required. A string expression. MessageParameters Required. An array of string variants. EnableDefault Required. An OLE_ENABLEDEFAULTBOOL.
If the ProcessProtocolMessages property is set to TRUE, this event is fired for incoming messages that are not internally treated by the control.
Fires after a QueryServerProperty call.
object_OnServerProperty(ServerItems)
Part Description object Required. An object expression that evaluates to an MsChatPr control. ServerItems Required. An object expression that evaluates to a ChatItems object.
This event can also be fired after a time-out occurs while accessing the ServerProperty property.
To determine the valid ServerItems of the object, use ValidItems property.
Fires for incoming server text messages.
object_OnServerTextMessage(ServerMessageType, Text)
Part Description object Required. An object expression that evaluates to an MsChatPr control. ServerMessageType Required. A variable of enumServerMessageType type. Text Required. A string expression that contains the text message.
Fires after a ListUsers or QueryUserProperty call.
object_OnUserProperty(UserItems)
Part Description object Required. An object expression that evaluates to an MsChatPr control. UserItems Required. An object expression that evaluates to a ChatItems object.
This event can also be fired after a time-out occurs while accessing the UserProperty property.
To determine the valid UserItems of the object, use ValidItems property.
Fires when a user property changes.
object_OnUserPropertyChanged(ModifiedNickname, ModifierNickname, UserPropertyName, OldUserProperty, NewUserProperty)
Part Description object Required. An object expression that evaluates to an MsChatPr control. ModifiedNickname Required. A string expression that contains the Nickname being modified. ModifierNickname Required. A string expression that contains the Nickname of the modifier, or it can be empty. UserPropertyName Required. A variant, the type of which depends on the user property name. OldUserProperty Required. A variant, the type of which depends on the old user property. NewUserProperty Required. A variant, the type of which depends on the new user property.
This event can occur after calling ChangeUserProperty or ChangeNickname, for example.
To determine the valid UserItems of the object, use the ValidItems property.
After logging in to a chat server, the Channel object is added to the Channels collection with the Add method.
This section lists the methods and properties supported by the Channel object.
ChannelName, ChannelProperty, ChannelState, ChannelTopic, Index, MemberCount, MemberIdentity, MemberModes, MemberProperty
BanMembers, ChangeChannelProperty, ChangeMemberProperty, CreateChannel, JoinChannel, KickMember, LeaveChannel, ListMembers, QueryChannelProperty, QueryMemberProperty, SendInvitation, SendMessage
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.