This documentation is archived and is not being maintained.

IUccCategoryInstance Interface

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.

Encapsulates a category instance of the generic type.

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

public interface IUccCategoryInstance : IUnknown
public interface IUccCategoryInstance extends IUnknown
public interface IUccCategoryInstance extends IUnknown

This is the base interface any strongly typed category instance is derived from. For example, a contact list item received as an IUccCategoryInstance is cast to the IUccContact interface to expose properties unique to a contact. The appropriate casting operation depends upon the category context to which the instance belongs.

An application can define its own generic category context and instance. In this case, the IUccCategoryInstance is not cast to an implementing interface. The interface defines the data type of a generic category instance. The value of a generic category instance is an XML string. The server is agnostic of the XML schemas used to describe the value but requires that it be well-formed. The client is responsible for parsing the XML value of such a category instance. A generic category instance can be used for a custom category instance.

Win32 COM/C++ Syntax

interface IUccCategoryInstance : IUnknown

This is an abbreviated example of an event handler for the OnCategoryInstanceAdded event. The example casts the base IUccCategoryInstance interface to the appropriate implementing interface. In this case, the interface is cast to the UccContactt or IUccGroup depending on the value of the category context Name property.

Regardless of what implementing interface IUccCategoryInstance is cast to, an application must advise for events raised by the base interface to receive category instance events.
void _IUccCategoryContextEvents.OnCategoryInstanceAdded(
   IUccCategoryContext pCategoryCtx, 
   UccCategoryInstanceEvent pCategory)
   IUccCategoryInstance ci = pCategory.CategoryInstance;
   switch (pCategory.CategoryInstance.CategoryContext.Name.ToLower())
      case "contacts":
         //cast category instance to contact and advise for 
         //contact events
         UccContact addedContact = pCategory.CategoryInstance as UccContact;
      case "groups":
         int Gcookie = 0;
         //cast category instance to group interface and advise
         //for group events
         IUccGroup addedGroup = pCategory.CategoryInstance as IUccGroup;
         int gGcookie = 0;

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