An ActiveX control is anything you might see in the Toolbox of Visual studio (i.e. EditBox, combobox e.t.c) we can even use the Activex controls in web pages using
Sink: A client that implements the outgoing interface of a component is called sink.
An application (Dialog or View ) that houses ActiveX control is called the control container. The control container communicates with a ActiveX control via methods and properties of a control.
ActiveX Control Properties:
There are two types of properties
Stack properties are common properties (Caption, foreground and background colors) that most controls expose. The COleControl data members provides stock properties implementation and also provides notification functions for the stock properties.
Custom properties are the properties which are specific to the control.
There are four different ways to implement Custom properties.
a. Member variable:
b. Member variable with notification function:
c. Get/Set methods
d. Parameterized (property array)
ActiveX Control Methods
There are two types of methods
The COleControl provides the stock methods implementation. there are only two stock properties
DoClick() – fires an event from the control
Refresh() – updates the control appearence
Custom methods are the methods which are specific to the control.
ActiveX Control Events
A member function of an outgoing interface is called an event. An activeX controlcan notify the containerof a state change using events.
There are two types of Events
The COleControl provides the common stock Events implementation like mouse button clicks and keyboard input.
Custom Events are the events which are specific to the control.