Initializing Controls

Once you have created a custom control, your application must add the control to a form with IASForm::Add. After a control is added, the form initializes the control by invoking the IASControl::Init method. This method provides the control with the following data:

The form can also set one or more of the control properties with the appropriate IASControl::put_* method. Methods commonly invoked include: IASControl::put_Visible and IASControl::SetBounds. These methods can be invoked later.

Controls should not start processing until their form invokes IASControl::Start. To verify if a control has been started, invoke the IASControl::IsStarted method. To shut the control down, a form invokes the control’s IASControl::Close method. When this occurs, a control should take the following actions:

  1. Stop processing
  2. Release any resources
  3. Release any reference counts that it has on other objects

A control should not release itself until all external reference counts on it have been released.