Adding an Instance of an ActiveX Designer

To add an instance of an ActiveX designer to a project, the end user clicks the Add ActiveX Designer command on the Project menu and selects a designer from those listed on the submenu. The list contains the names of all the ActiveX designers that have been added to the development environment. In response, Visual Basic takes the following steps:

  1. Creates a visual designer object. Visual Basic calls CoCreateInstance, passing the CLSID of the visual designer, to create a visual designer to manage the user interface. The designer's class factory ensures that any required licenses are present. If so, it creates the object.
  2. Initializes the visual designer. Visual Basic calls IOleObject::SetClientSite to associate the designer with a site. Then it calls the InitNew or Init method of the designer's persistence interface to load the designer's persistent data.
  3. Displays the visual designer. Visual Basic provides a frame and uses ActiveX and COM interfaces to display the user interface.

Visual Basic creates a default instance of the visual designer in much the same way that it creates a default instance of Form1.