This documentation is archived and is not being maintained.

_IUccPresentityEvents.OnCategoryContextRemoved 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 category context is removed from the specified presentity object.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in

void OnCategoryContextRemoved (
	UccPresentity pPresentity,
	UccCategoryContextEvent pCategoryCtxtEvent
void OnCategoryContextRemoved (
	UccPresentity pPresentity, 
	UccCategoryContextEvent pCategoryCtxtEvent
function OnCategoryContextRemoved (
	pPresentity : UccPresentity, 
	pCategoryCtxtEvent : UccCategoryContextEvent



A value of the IUccPresentity* (UccPresentity, for a .NET application) type. This represents the publisher of the removed category context.


A value of the IUccCategoryContextEvent* (UccCategoryContextEvent, for a .NET application) type. This specifies the event data that represents the removed category context.

This event is received for both self-presentity category context and remote user presentity category context. In both cases, a client should unadvise for the IUccCategoryContext object retrieved by reading the CategoryContext value from the IUccCategoryContextEvent and providing the value as the event sink when un-advising for events.

A local client receives this event for each subscribed category context at the time the client has called into Disable on the endpoint instance.The OnCategoryContextRemoved event is also received when the local client has unsubscribed to the category context or called into RemovePresentity. The client will no longer receive category context events for the removed category context.

Win32 COM/C++ Syntax

HRESULT OnCategoryContextRemoved
   IUccPresentity* pPresentity,
   IUccCategoryContextEvent* pCategoryCtxtEvent
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 example handles the OnCategoryContextRemoved event. The essential task it accomplishes is to unadvise for the category context events previously advised for on this category context object.

void _IUccPresentityEvents.OnCategoryContextRemoved(
    UccPresentity pEventSource, 
    UccCategoryContextEvent pEventData)
        pEventData.CategoryContext, this);

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