Platform SDK: Certificate Enrollment Control

The Certificate Enrollment Control Instantiated in Visual Basic

The following example uses CreateObject to create an instance of the Certificate Enrollment Control object. When the object is no longer needed, it is freed from memory by setting it to the Visual Basic value Nothing.

Example in Visual Basic

Private Sub Command1_Click()
    ' Declare the object variable.
    Dim objXen As Object

    ' Before creating object, enable error handler.
    On Error GoTo Err_Object

    ' Create an instance of the object.
    Set objXen = CreateObject("CEnroll.CEnroll.1")

    ' Disable error handler.
    On Error GoTo 0

    ' Object successfully instantiated.
    ' use object as needed
    ' ...

    ' Done processing, free resource.
    Set objXen = Nothing

    Exit Sub

Err_Object:

    MsgBox ("Unable to create CEnroll object")

End Sub