Partager via


Create and Enable a Profile

The following code example shows how to create the Profile object and enable the profile for use by the RTC API. The operations in the Initialize the Communications Service example must be performed before using this code.

**Note   **This code has not been thoroughly tested, does not contain error checking, and is not intended for production use.

IRTCClientProvisioning *pIRTCClientProvisioning = NULL;
IRTCProfile *pIRTCProfile  = NULL;
BSTR bstrXMLProfile =  // XML Blob referenced in different section.
// Perform QI for the Provisioning interface.
hr = pIRTCClient->QueryInterface(IID_IRTCClientProvisioning,
                  reinterpret_cast<void **>(&pIRTCClientProvisioning);
// if (hr != S_OK) process error here. 
// Create the Profile object.
hr = pIRTCClientProvisioning->CreateProfile( bstrXMLProfile,
                                             &pIRTCProfile );
// if (hr != S_OK) process error here. 
// Enable the Profile and Register. 
hr = pIRTCClientProvisioning->EnableProfile( pIRTCProfile, 
                                             RTCRF_REGISTER_ALL);
// if (hr != S_OK) process error here. 

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.