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?
 

Active x

  • 1.
    ACTIVE-XCONTROL 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]
  • 2.
    PRESENTATION OUTLINE IntroductionActive-x control Vs Ordinary Wnd control Installing Active-x Controls The Calendar Controls Active-x Control Container Programming Create Active-x Control at Runtime
  • 3.
    INTRODUCTION OLE ControlsUsed by Application Developers Written in C++ (ATL Library)
  • 4.
    ACTIVE-X CONTROL VSORDINARY WINDOWS CONTROL Ordinary Control Child Window Standard Window Messages CWnd Class Separate DLL
  • 5.
    ACTIVE-X CONTROL VSORDINARY WINDOWS CONTROL Similarities Child Window WM_CREATE handler Container
  • 6.
    WAYS TO WRITEAN ACTIVEX CONTROL Microsoft Foundation Class (MFC) Active-X Template Library (ATL) Base Ctrl Framework Visual J++ (COM Object only)
  • 7.
    PROPERTIES & METHODSProperties 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.
  • 8.
    INSTALLING ACTIVEX CONTROLChoose add to project from the project menu and choose components and controls Select registered ActiveX controls
  • 9.
    INSTALLING ACTIVEX CONTROLTo copy the ActiveX controls DLL \windows\system for Microsoft win95 Register controls in windows registry
  • 10.
  • 11.
    THE CALENDAR CONTROLSProperties Back Color Day,etc.. Methods NextDay Next Week,etc.. Events Keydown Keyup,etc..
  • 12.
    ACTIVEX CONTROL CONTAINERPROGRAMMING Child window DDX and its Property value
  • 13.
    PROPERTY ACCESS TheActiveX control developer design Control and choose Properties. Design-time properties
  • 14.
    CLASS WIZARD'S C++WRAPPER CLASSES FOR ACTIVEX CONTROLS C++ wrapper class Dynamically create an instance Match with Dispatch ID Set and Get functions
  • 15.
    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); }
  • 16.
    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); }
  • 17.
    APPWIZARD SUPPORT FORACTIVEX 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>
  • 18.
    CLASSWIZARD AND THECONTAINER DIALOG Data members functions Event handler functions
  • 19.
    MAPPING ACTIVEX CONTROLEVENTS Windows messages and command messages Dialog class contains one or more ActiveX controls It works something like a message map.
  • 20.
    CREATING ACTIVEX CONTROLSAT RUNTIME ClassWizard will create the files Constructed and destroyed Manually add the necessary event message handlers
  • 21.
  • 22.