active x
DESCRIPTION
TRANSCRIPT
ACTIVE-X CONTROL
Guided by,
Ms. K. JAYAPRIYA, B. Tech., LECTURER OF MCA,
Presented by,
A.ARCHUNAN, [MCA963]S.KARTHICK, [MCA969]P.MUTHU KUMAR, [MCA978]A.SENTHIL KUMAR, [MCA999]S.SURESH, [MCA9104]
PRESENTATION OUTLINE
Introduction Active-x control Vs Ordinary Wnd control Installing Active-x Controls The Calendar Controls Active-x Control Container Programming Create Active-x Control at Runtime
INTRODUCTION
OLE Controls
Used by Application Developers
Written in C++ (ATL Library)
ACTIVE-X CONTROL VS ORDINARY WINDOWS CONTROL
Ordinary Control
Child Window Standard Window Messages CWnd Class Separate DLL
ACTIVE-X CONTROL VS ORDINARY WINDOWS CONTROL
Similarities
Child Window
WM_CREATE handler
Container
WAYS TO WRITE AN ACTIVEX CONTROL
Microsoft Foundation Class (MFC)
Active-X Template Library (ATL)
Base Ctrl Framework
Visual J++ (COM Object only)
PROPERTIES & METHODS
Properties have symbolic names Index value Dialog Data exchange Methods are like functions It does not send WM_Notification Event does not return value Example
Key Down, New Month.
INSTALLING ACTIVEX CONTROL
Choose add to project from the project menu and choose components and controls
Select registered ActiveX controls
INSTALLING ACTIVEX CONTROL
To copy the ActiveX controls DLL \windows\system for Microsoft win95
Register controls in windows registry
THE CALENDAR CONTROLS
THE CALENDAR CONTROLS
Properties Back Color Day,etc..
Methods NextDay Next Week,etc..
Events Keydown Keyup,etc..
ACTIVEX CONTROL CONTAINER PROGRAMMING
Child window
DDX and its Property value
PROPERTY ACCESS
The ActiveX control developer design
Control and choose Properties.
Design-time properties
CLASS WIZARD'S C++ WRAPPER CLASSES FOR ACTIVEX CONTROLS
C++ wrapper class Dynamically create an instance Match with Dispatch ID Set and Get functions
CLASS WIZARD'S C++ WRAPPER CLASSES FOR ACTIVEX CONTROLS
unsigned long CCalendar::GetBackColor(){ unsigned long result; InvokeHelper(DISPID_BACKCOLOR, DISPATCH_PROPERTYGET,
VT_I4, (void*)&result, NULL); return result;}void CCalendar::SetBackColor(unsigned long newValue){ static BYTE parms[] = VTS_I4; InvokeHelper(DISPID_BACKCOLOR, DISPATCH_PROPERTYPUT,
VT_EMPTY, NULL, parms, newValue);}
CLASS WIZARD'S C++ WRAPPER CLASSES FOR ACTIVEX CONTROLS
void CCalendar::NextDay()
{
InvokeHelper(0x16, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
void CCalendar::NextMonth()
{
InvokeHelper(0x17, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
APPWIZARD SUPPORT FOR ACTIVEX CONTROLS
AppWizard inserts the class Initinstance
Class InitInstance member function: AfxEnableControlContainer();
It also inserts the following line in the project's StdAfx.h file:
#include <afxdisp.h>
CLASSWIZARD AND THE CONTAINER DIALOG
Data members functions
Event handler functions
MAPPING ACTIVEX CONTROL EVENTS
Windows messages and command messages
Dialog class contains one or more ActiveX
controls
It works something like a message map.
CREATING ACTIVEX CONTROLS AT RUNTIME
ClassWizard will create the files
Constructed and destroyed
Manually add the necessary event message
handlers
QUERIES?