Chapter 10: Scriptable Objects and ATL

 < Free Open Study > 



Objectives:

  • Come to understand the IDispatch interface and late binding.

  • Learn how to implement a dispinterface with (and without) type information.

  • Learn to create a dual interface, and why you might want to do so.

  • Work with automation SAFEARRAYs.

  • Access COM objects from MS Internet Explorer using VBScript.

  • Understand ATL's support for IDispatch.

The vTable COM interface is a wonderful thing. As you have already seen, the popular languages of our time (VB, Java, C++) all have the ability to work with your COM objects and access their functionality using custom vTable interfaces. This was not always the case, however. Historically speaking, VB was unable to work with custom vTable interfaces, and the only way in which your object's functionality could be used was through a standard COM interface named IDispatch.

These days, the only COM-aware languages that must work with an object using IDispatch are scripting environments such as VBScript and JScript. In this light, we may call a COM object supporting IDispatch a scriptable object, although historically speaking IDispatch-based objects are termed automation objects. This chapter examines how to create scriptable COM objects and a number of late bound clients.



 < Free Open Study > 



Developer's Workshop to COM and ATL 3.0
Developers Workshop to COM and ATL 3.0
ISBN: 1556227043
EAN: 2147483647
Year: 2000
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net