Retrieve the Security Level for the Client Object

The following code examples demonstrate how to retrieve the security level for the client object. The operations in the Initialize RTC code example must be performed before using this example.

Note  This example does not contain error checking or releases appropriate for real code.

C++ Code Example

HRESULT hr = S_OK;
IRTCClient2 *pClient2 = NULL;				
RTC_SECURITY_LEVEL  enAVLevel;
RTC_SECURITY_LEVEL  enT120Level;

// Cocreate and initialize the client object here. 
// See the "Initialize RTC" code example to 
// CoCreate the client object.

// Get the current security level for the Audio/Video 
// media types that are set on the client object. 
// Note: Audio and Video security are set together not
// seperately. 
hr = pClient2->get_PreferredSecurityLevel(RTCSECT_AUDIO_VIDEO_MEDIA_ENCRYPTION, 
                                          &enAVLevel);

// If (hr != S_OK), process the error here. 

// Get the current security level for the T120 media type.
// Note: If the T120 security level is set from Netmeeting, 
// this setting will be returned.
hr = pClient2->get_PreferredSecurityLevel(RTCSECT_T120_MEDIA_ENCRYPTION, 
                                          &enT120Level);

// If (hr != S_OK), process the error here. 
 

Visual Basic Code Example

' Set the error handling routine here. 
' On Error GoTo MyErrorRoutine 

'Usually declared globally 
Private g_objClient2 As IRTCClient2

Dim securityLevelAV As RTC_SECURITY_LEVEL
Dim securityLevelT120 As RTC_SECURITY_LEVEL

' Create and initialize the client object here. 
' See the "Initialize RTC" code example to 
' create the client object.

' Retrieve the security level information for 
' a particular media type on the client object.

'Get the security level for the Audio/Video media types.
securityLevelAV = g_objClient2.PreferredSecurityLevel(RTCSECT_AUDIO_VIDEO_MEDIA_ENCRYPTION)

'Get the security level for the T120 media type. 
securityLevelT120 = g_objClient2.PreferredSecurityLevel(RTCSECT_T120_MEDIA_ENCRYPTION)