This documentation is archived and is not being maintained.

IUccCredentialCache.CreateCredential 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.

Creates a new instance of a credential.

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

UccCredential CreateCredential (
	string bstrUserName,
	string bstrPassword,
	string bstrDomain
)
UccCredential CreateCredential (
	String bstrUserName, 
	String bstrPassword, 
	String bstrDomain
)
function CreateCredential (
	bstrUserName : String, 
	bstrPassword : String, 
	bstrDomain : String
) : UccCredential

Parameters

bstrUserName

A value of the BSTR (string, for a .NET application) type. This string holds the user name for authentication by Office Communications Server.

bstrPassword

A value of the BSTR (string, for a .NET application) type. This string holds the user password for authentication by the server.

bstrDomain

A value of the BSTR (string, for a .NET application) type. This string holds the network domain to which the user is a registered user.

Return Value

A value of the IUccCredential** (IUccCredential, for a .NET application) type. The result represents the credential of the specified user and can be passed to the SetCredential method of this interface.

Win32 COM/C++ Syntax

HRESULT CreateCredential
(
   BSTR bstrUserName,
   BSTR bstrPassword,
   BSTR bstrDomain,
   IUccCredential** ppCredential
);
Cc667875.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 creates a reference to an instance of the UccCredential class from a credential cache factory object.

private UccCredential NewCredential(
   IUccServerSignalingSettings pServer, 
   string pUserName, 
   string pPassword, 
   string pDomain)
{
   UccCredential returnValue = null;
   UccCredentialCache credentialCache = pServer.CredentialCache;
   returnValue = credentialCache.CreateCredential(
      pUserName, 
      pPassword, 
      pDomain);
   return returnValue;
}

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: