Active x

1,206 views

Published on

Published in: Education, Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,206
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
25
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Active x

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

×