CreateChannel MethodCreateChannel Method*
*



Contents  *



Index  *Topic Contents
*Previous Topic: ChangeMemberProperty Method
*Next Topic: JoinChannel Method

CreateChannel Method

Creates a channel on IRCX servers only.

Syntax

object.CreateChannel [ChannelName][, ChannelKeyword][, ChannelModes][, MaxMemberCount]

Parameters

objectRequired. An object expression that evaluates to a Channel object.
ChannelNameOptional. A variant. If specified, must be empty or contain a valid channel Name. If the parameter is empty or not specified, the current value of the ChannelName property is used instead.
ChannelKeywordOptional. A variant. If specified, must be empty or a string. If the parameter is empty or not specified, the channel will be created with no Keyword set.
ChannelModesOptional. A variant. If specified, must be empty or a number (integer or long) that is a valid channel Modes value. A valid ChannelModes parameter is a combination of some of the values from the enumChannelMode enumeration. The valid components of a ChannelModes value are:
cmPublic&H0.
cmPrivate&H1.
cmHidden&H2.
cmSecret&H4.
cmModerated&H8.
cmNoExtern&H10.
cmTopicop&H20.
cmInvite&H40.
cmKnock&H80.
cmNoWhisper&H100.
cmService&H400.
cmAuthOnly&H800.
cmCloneable&H1000.
cmAuditorium&H4000.
cmNoFormat&H8000.
cmCreateOnly&H10000000.

The cmPrivate, cmHidden, and cmSecret values are mutually exclusive. If the cmCreateOnly flag is set, the CreateChannel call will fail if the channel already exists. If this flag is not set, the caller will join the channel if it already exists.

If the ChannelModes parameter is empty or not specified, the channel Modes value will be defined by the server's default settings.

MaxMemberCountOptional. A variant. If specified, the MaxMemberCount parameter must be empty or a number (integer or long) that is a valid maximum member count. If the parameter is empty or not specified, the maximum member count of the channel will be defined by the server's default settings.

Remarks

The channel state must be chsClosed for the call to succeed, and the channel must belong to the collection for the call to be successful.

A successful CreateChannel calls results in an OnChannelState event in which the channel state is chsOpening, then an OnChannelState event is fired with the channel state chsClosed or the following suite of events.
Event Parameters
OnChannelState (Channel, chsOpening)
OnChannelState (Channel, chsOpen)
OnBeginEnumeration    (Channel, etInitialMembers)
OnAddMember (Channel, Nickname, MemberItems)
OnEndEnumeration (Channel, etInitialMembers)
OnChannelProperty (Channel, ChannelItems)

Examples

1. Specify all the parameters:

MsChatPr1.Channels(1).CreateChannel "#MyRoom", "SecretPassword", cmTopicop +  cmCreateOnly, 20

2. Omit the ChannelKeyword and MaxMemberCount parameters:

MsChatPr1.Channels(1).CreateChannel "#MyRoom", , cmCreateOnly

3. Use empty variants:

MsChatPr1.Channels(1).CreateChannel "#MyRoom", Empty, 
cmCreateOnly, Empty

See Also

ChannelName, ChannelState, enumChannelMode, JoinChannel, OnChannelState


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.