Share via


IRTCClientPresence2::AddGroup

The AddGroup method adds a new buddy group. A client can have a maximum of 64 groups.

HRESULT AddGroup(BSTRbstrGroupName,
BSTRbstrData,
IRTCProfile*pProfile,
longlFlag,
IRTCBuddyGroup**ppGroup);

Parameters

  • bstrGroupName
    [in] BSTR containing the name of the group.
  • bstrData
    [in] An optional private data BLOB.
  • pProfile
    [in] Pointer to an IRTCProfile interface specifying a provisioning profile to use for this Group. It is taken into account only when the RTCCS_FORCE_PROFILE flag is specified in lFlags; otherwise, it must be set to NULL, and the RTC API automatically chooses the best profile to use. If the RTCCS_FORCE_PROFILE flag is set and the parameter is NULL, no profile is used.
  • lFlag
    [in] RTCCS_ flags indicating the force profile flag setting.
  • ppGroup
    [out] Returns a pointer to the IRTCBuddyGroup interface on the newly created group object. This parameter may be NULL, indicating that the method should not return an interface. This call adds a reference to the group object, which the caller is responsible for releasing.

Return Values

RTC methods may return an RTC_E_ constant.

Value Meaning
RTC_E_GROUP_EXISTS The group already exists.
RTC_E_TOO_MANY_GROUPS The client already has the maximum number of groups allowed.
RTC_E_CLIENT_NOT_INITIALIZED The client object hs not been initialized.
E_INVALIDARG The bstrGroupName parameter is NULL.
E_POINTER The ppGroup parameter is not a valid pointer.

Remarks

When contact roaming is enabled, the AddGroup operation is asynchronous. The application must wait for the RTCE_GROUP event with event type RTCGET_GROUP_ADD to retrieve the IRTCBuddyGroup interface. The IRTCBuddyGroupEvent::get_Buddy method returns the IRTCBuddyGroup interface.

Requirements

Redistributable: Requires Rtcdll.dll on Windows 2000, Windows XP, and Windows Server 2003.
Header: Declared in Rtccore.h.
Library: Included as a resource in Rtcdll.dll.
GUID: IID_IRTCClientPresence2 is defined as AD1809E8-62F7-4783-909A-29C9D2CB1D34.

See Also

IRTCClientPresence2, IRTCClientPresence, IRTCClientPresence2::RemoveGroup, Create a Buddy Group and Add Buddies