1 / 29

ActiveX and The Internet

ActiveX and The Internet. CIS 241 - Advanced Visual Basic. Active X Types. Active X components Active X controls Active X documents. Component Object Model. Defines software components COM Language independent Application Server Client. ActiveX Components.

Download Presentation

ActiveX and The Internet

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ActiveX and The Internet CIS 241 - Advanced Visual Basic

  2. Active X Types • Active X components • Active X controls • Active X documents

  3. Component Object Model • Defines software components • COM • Language independent • Application • Server • Client

  4. ActiveX Components • Standard class placed in its own application separate from any other application that uses is • ActiveX Component application is the server application • Applications that use it are clients

  5. ActiveX Components • Types • ActiveX Dll • ActiveX Exe • Client View • Black box to clients • Client sees only the interface • Client may create and communicate with components • Roles of Programmers • Author (Designer) • Developer (User)

  6. Instancing Property • Private • PublicNotCreatable • MultiUse • GlobalMultiUse

  7. Type Libraries • Information for object browser • Enable applications to reference interface • Used for early binding

  8. Creating an ActiveX Component • New project ActiveX dll (server project) • Properties page • Add class module(s) • Set instancing property for each class • Create dll • Testing the component

  9. Project Properties Page • Name • Description • Component Tab • Project Compatibility • Binary Compatibility • No Compatibility

  10. Active X Controls • Any non-intrinsic control • Composite or from scratch • Author • Developer

  11. Understanding Controls • Design Time • Drag on form • Default values • Design time values • Run Time • Created at start of run • Run time values • Closed at end of run

  12. Events That Are Raised • Initialize • InitProperties • ReadProperties • Terminate • WriteProperties

  13. Activity on Control Developer Action Control Action Event Occurs

  14. Creating a New Control • New control • Add user control to current project • New project type activeX control • Project Description • Toolbox Bitmap Property • Draw Control • Initial Events • Intialize • InitProperties

  15. Properties • Author accesses parts • Programmer only what author exposes • Delegating • Let/Get • Varient

  16. Property Persistence • Property Bag • UserControl_WriteProperties PropBag.WriteProperty propName, Value, Default Value • UserControl_ReadProperties Value = PropBag.ReadProperty(propName, Default Value) • Let Property propName PropertyChanged propName

  17. Changing the Look • Ambient Properties Object • Values • Ambient Changed Event Handler for Control • Resize Event for Control • Keep in range • Keep things centered

  18. Author Defined Events • Author Actions • Public Event eventName() • RaiseEvent eventName() • Developer Response • myControl_eventName

  19. Active X Documents • Run in a container • May be a dll or exe • Consists of UserDocuments

  20. UserDocuments • Each has its own designer • Menus • Files • dob • vbd • while testing • after compilation • UserDocument_Initialize

  21. Hyperlink Object • Available in a UserDocument • NavigateTo • GoBack • GoForward

  22. Making Properties Persistent • PropertyBag • Event • UserDocument_WriteProperties(PropBag as PropertyBag) • UserDocument_ReadProperties(PropBag as PropertyBag) • UserDocument Method • WriteProperty • ReadProperty • PropertyChanged

  23. Sharing Data Between Documents • Standard Code Module Used • Declare global anything to be shared • Initialize in Main document Initialize event • Can be used in any documents

  24. VB WebBrowser • Microsoft Internet Controls • Navigate • Catching a bad URL

  25. Dynamic HTML • Dynamically alter web pages • Each web page has a designer

  26. Web Page Controls • Button • TextField • TextArea • Option • Checkbox • Select • Image • Hyperlink • HiddenField

  27. Web Page Events • onload • onunload • onreadystagechange • onclick • onfocus • onblur • onmouseup

  28. Dynamic Styles • bgcolor • fgcolor • backgroundcolor • color • border • font

  29. Managing State • Standard Code Module • Cookies • Base Window • PutProperty • GetProperty

More Related