This documentation is archived and is not being maintained.

_IUccContactEvents.OnAddedToGroup Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Raised when a contact is added to a group.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)

void OnAddedToGroup (
	UccContact pEventSource,
	UccGroupMembershipEvent pEventData
)
void OnAddedToGroup (
	UccContact pEventSource, 
	UccGroupMembershipEvent pEventData
)
function OnAddedToGroup (
	pEventSource : UccContact, 
	pEventData : UccGroupMembershipEvent
)

Parameters

pEventSource

A value of the IUccContact* (UccContact, for a .NET application) type. This represents the contact who is added to a specified group.

pEventData

A value of the IUccGroupMembershipEvent* (UccGroupMembershipEvent, for a .NET application) type. This contains the group to which the specified contact is added.

This event is raised by the platform in either of two scenarios. In the first scenario, an Office Communications Server is provisioning the client with the signed on user's contact list. For each group a given contact has membership in, this event provides an interface to that group object. The client should use the event raised in this scenario to update a local cache of contact group membership for display in the client UI.

The second scenario involves a Unified Communications Client API application user adding a contact to a group membership list. This action cause the platform to raise the OnAddedToGroup event after the Office Communications Server has processed the group membership request.

Win32 COM/C++ Syntax

HRESULT OnAddedToGroup
(
   IUccContact* pEventSource,
   IUccGroupMembershipEvent* pEventData
);
Cc703193.note(en-us,office.12).gifNote:
In a Win32 application, the return value of a method or property is always an HRESULT value indicating the status of the call to the interface member. Any result of the operation is returned as a parameter marked with the [out, retval] attribute. In contrast, in a .NET application the HRESULT value indicating an error condition is returned as a COM exception and the [out, retval] parameter becomes the return value. For the UCC API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API .

The following example adds a group name to a List (cl). The client is excluding the "~" group membership of the given contact.

void _IUccContactEvents.OnAddedToGroup(
     UccContact pEventSource, 
     UccGroupMembershipEvent pEventData)
{

if (pEventData.Group.Name != "~")
cl.Add(pEventData.Group.Name);
}
}

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2000 with Service Pack 4, Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Show: