Modifying a Control's Run-Time Behavior

JavaScript EditorDhtml editor     Free javascript download 



Main Page

After you insert a control and generate one or more wrapper classes, you can invoke the control's methods and program the control's event handlers.

The control's wrapper classes specify the functions you can use to modify the run-time behavior of the control. Include the appropriate wrapper class header file and use the methods. To set a property, look for an accessor method with the property name prefixed by Set. To retrieve a property, look for an accessor method with the property name prefixed by Get. Event handlers can be written later.

Because the controls are implemented using Automation, the types passed can only be Automation-safe types such as BSTR and VARIANT. While you can use system calls to allocate and set BSTRs and VARIANTs, you might want to use the ATL wrapper classes (CComBSTR, CComVariant), the Visual C++ COM Compiler support wrapper classes (_bstr_t, _variant_t), or the MFC wrapper class (COleVariant).

If you add a data control, the Insert ActiveX Control Wizard generates wrapper classes for the data control's coclasses that manage its internal data objects. These classes do not include all of RDO or ADO, but rather represent internal objects declared in the type library.

If you want to use ADO and RDO directly, you should connect to the ADO or RDO DLLs directly (Msado15.dll or Msrdo20.dll), either with the compiler COM support classes, which support the #import directive, or with the respective SDK.

Expand imageTo Set Control Properties at Run Time

Expand imageSee Also



JavaScript EditorDhtml editor     Free javascript download