Ø An ActiveX control is a reusable software component based on the
Component Object Model (COM) that supports a wide variety of OLE functionality
and can be customized to fit many software needs. ActiveX controls are designed
for use both in ordinary ActiveX control containers and on the Internet, in
World Wide Web pages.
Ø Interaction Between an
ActiveX Control Container and a Windowed ActiveX Control
Ø An ActiveX
control can draw itself in its own window, respond to events (such as mouse clicks),
and be managed through an interface that includes properties and methods.
Ø These
controls can be developed for many uses, such as database access, data
monitoring, or graphing.
Ø An
ActiveX control is controlled by using three things:
a. Property: Attribute of the
control that can be modified by container application. (like name, background
color, Font etc)
b. Methods: Functions called by
container application.
c. Events: The Messages that can be send from control
to the container application.
Steps to create ActiveX Control:
File->New->Project->Select
MFC ActiveX Control Wizard->Specify
Project name(say ActiveXDemo)->Click OK
Now invoke the class wizard and add
properties and appropriate messages from there(like WM_LBUTTONDOWN)
Then Edit the code in ActiveXDemoCtl.cpp
for WM_LBUTTONDOWN:
Void
CActiveXDemoCtrl::OnLButtonDown(UINT flag,CPointpt)
{
MessageBox(“Left Button is
Pressed”);
}
No comments:
Write comments