Share via


Programming Patterns with Platform Object

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.

The following code example demonstrates the programming pattern using the platform object in Unified Communications Client API. The example shows the following features:

  • Instantiate an IUccPlatform object. An application can obtain the IUccPlatform interface pointer by initiating the UccPlatform co-class. The UccPlatform object is a singleton object. Therefore, repeated attempts to instantiate the platform object always returns the same instance.
  • Optionally, advise the platform of implemented platform event handlers. A platform object can raise various events as defined in the following event interfaces:
  • Initialize the UccPlatform object. The resultant platform object must be initialized (Initialize) before it can be used as the endpoint factory. An attempt to use a non-initialized platform object results in a UCC_E_PLATFORM_NOT_INITIALIZED error message (HRESULT value = 0x80EE0025). For a list of error messages, see Unified Communications Client API Error Messages. The platform object provides two essential functions:
    • Create a SIP endpoint (CreateEndpoint) or proxy endpoint (CreateProxyEndpoint). For more information about endpoints, see Endpoint Object.
    • Shut down the platform (Shutdown). Shutting down the platform is an asynchronous call. A client must implement and register for _IUccPlatformEvents to receive the status of the call in an OnShutdown event.
  • A client application can also choose to handle the media device manager events by advising for and implementing the _IUccMediaDeviceManagerEvents interface, if the application manages media devices. The application can also do so after an IUccMediaDeviceManager interface pointer is obtained.

To review C# examples of this programming pattern, see Creating and Initializing a Platform Object.

See Also

Concepts

Code Listing: Basic Event Registration and Other Helper Methods in C#