This documentation is archived and is not being maintained.

IUccPlatform.Initialize 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.

Initializes the UCC API application framework.

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

void Initialize (
	string bstrApplicationName,
	UccContext pContext
)
void Initialize (
	String bstrApplicationName, 
	UccContext pContext
)
function Initialize (
	bstrApplicationName : String, 
	pContext : UccContext
)

Parameters

bstrApplicationName

A value of the BSTR (string, for a .NET application) type. This specifies the application name identifying where the global registry settings and tracing are located. The string cannot be passed as a null value, contain an '*' character, or Unicode formatting characters.

pContext

A value of the IUccContext* (UccContext, for a .NET application) type. The default value is NULL. This represents the application-defined metadata associated with this instance of the application framework. A context object can be obtained by co-creating a UccOperationContext object. This parameter value can be NULL.

An application must call this method before using any other features of the UCC API. Using an uninitialized platform object results in error. The bstrApplicationName string must not contain a '*' character or any Unicode formatting characters. It is a good idea to restrict the range of characters to those used in a valid file name.

Win32 COM/C++ Syntax

HRESULT Initialize
(
   BSTR bstrApplicationName,
   IUccContext* pContext
);
Cc715674.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 initializes a client platform with the client process name. The example method throws an exception if the passed string is out of the range of letters, numbers or normal punctuation.

/// <summary>
/// Intitializes a platform object using the passed intitialization string.
/// </summary>
/// <param name="platformName">string to initialize the platform with</param>
private void InitializePlatform(string platformName)
{
    if (platformName == null || platformName.Contains("*") )
    {
        throw new ArgumentOutOfRangeException(
            "platformName", 
            "Parameter cannot contain a '*'");
    }
    UccContext ctxt = new UccContext();
    ctxt.AddNamedProperty("Platform Name", platformName);
    this.platform.Initialize(platformName, ctxt);

}

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: