Microsoft DirectX 8.1 (C++)

Obtaining the CA Manager (Visual Basic)

This topic applies to Windows XP Home Edition and Windows XP Professional only.

The CAManager is a feature object that implements the IMSVidFeature interface. The Video Control always activates this feature; when you set up the active features, you do not have to specify the CA feature explicitly, because the Video Control automatically adds it to the active features collection.

Always obtain the CAManager object from the active features collection, never from the available features collection. Otherwise, you will obtain the wrong instance of the CAManager. However, this rule brings out a potential pitfall: If you do not specify any active features, the value of the FeaturesActive property defaults to Nothing. In that case, the Video Control creates a new features collection when the application builds or runs the filter graph. To avoid errors, obtain the CAManager after building the graph.

The following code example shows what to do:

Private WithEvents mCAManager as CAManager.
Const clsid = "{1600F101-6666-4F66-B1E2-BF3C9FBB9BA6}"

' Activate other features, such as closed captions. (Not shown.)
' Get the tune request. (Not shown.)

mVideoControl.View iTuneRequest  ' Submit the tune request.
mVideoControl.Build ' Build the graph.

' Find the CA Manager.
Dim iFeature As IMSVidFeature
For Each iFeature In mVideoControl.FeaturesActive
    If (UCase(iFeature.ClassID) = clsidCA) Then
        Set mCAManager = iFeature
        Exit For
    End If
Next
If (mCAManager Is Nothing) Then
    MsgBox "Could not find the CAManager.", vbExclamation
End If

See Also