160 likes | 291 Views
Energizing Your Programs With ActiveX. What is ActiveX What will it do for me How can I use it. What is ActiveX. It is a tried-and-tested control Progressbar Multi-object Calendar WebBrowser Interact with it Call Functions and Procedures Set Properties Receive Events
E N D
Energizing Your Programs With ActiveX • What is ActiveX • What will it do for me • How can I use it
What is ActiveX • It is a tried-and-tested control • Progressbar • Multi-object Calendar • WebBrowser • Interact with it • Call Functions and Procedures • Set Properties • Receive Events • Can be Visual or non-visual • Html-Label • Spell Checker
What Will It Do For Me • Enable you to add powerful or visual features immediately and cheaply • Add capabilities otherwise unavailable • Save development time • How long would it take to write a spell-checker or graphics utility? • Now multiply that by five
How Can I Use It • Obtain the controls • Import them in the IDE • Drag them from the Controls Palette
Obtaining ActiveX Controls • Built-in • Imaging, Animation, Video, etc • Buy • Magazines such as Visual Developer, etc • Download • Download from www.ActiveX.com, etc
Import Into The IDE • Two parts • The easy, fun, visual side • The difficult, complex, error-prone, time-consuming never-gonna-get-it-all-working side
Import Into The IDEThe easy part • You Do: • Select from Registered Controls • Global or Workspace • Simple or Data-Aware
Import Into The IDEThe not-easy part • The IDE Does: • Create the PKG Class-File • Creates the DFC file • Creates the DFO • Creates the bitmap (both) • Registers in the Class-List • Puts on Controls Palette
Dragging From The Controls Palette • Property Page • PropertyFile/.OCP • OnCreate • Com/OnCom prefixes
What We’re Going To Do Next • Create several Simple ActiveX Controls • Create two Data-Aware ActiveX Controls • Show Property Pages • Show using the OnCreate event to set the ActiveX properties • Using regular controls to interact with the ActiveX controls
And For Free • Learn the common mistakes • Learn how to use the new Code Explorer and Error Reconciliation to fix bugs
Simple ActiveX Controls • Instance of the cComControl • cHtmlLabel • cFolderPicker • cRichTextBox • cCoolProgressBar • cAnalogClock • cSpellChecker • cSimplePrinter
Data-Aware ActiveX Controls • Instance of the cDbComControl • Need to provide two events • OnRefreshDbOcxValue (DD->DEO) • ??? (DEO->DD) • (//ToDo: Ctrl+T) • cDbDatePicker • cDbBitmap
cDbDatePicker • Provide a popup calendar for Date fields • Import as Global • Import from Windows Common Controls-2 • Data-Events • OnRefreshDbOcxValue (DD->DEO) • OnComChange (DEO->DD)
cDbBitmap • Replacement for the dbBitmap class to show JPG/BMP/GIF, etc • Import from built-in Kodak Image Edit • Set it as the Visual Control in DBB • Implement Zoom feature with Trackbar • Data-Events • OnRefreshDbOcxValue (DD->DEO) • Relative vs Absolute pathing • Displaying • Clearing
Where Next • Run the COM sample Workspace • Read the Help • Importing ActiveX Controls (IDE) • Outlines the process and has a tutorial • COM Class Reference • Close PowerPoint and do it!