Navigation:  Programming Cookbook > External Interfacing > Virtual Calls (C++/OLE COM Interface) >

OLE/COM/Active-X Functions

Previous pageReturn to chapter overviewNext page

The virtual call interface is the basis of OLE/COM/Active-X interface call-out support in Dolphin. For example IUnknown (a subclass of ExternalStructure) contains the method:

QueryInterface: QueryInterface ppvObject: ppvObject

  "Callout for the IUnknown::QueryInterface() interface function.

  N.B. This method has been automatically generated from

  the vtable defined in IUnknown>>defineFunctions. DO NOT MODIFY!"

  <virtual stdcall: sdword 1 IID* lppvoid >

  ^self invalidCall

 

Note that this method has been generated automatically from the class' function table, a facility of the OLE COM package, but is in other respects simply an external virtual function call.

Typically it is not necessary to manually build wrapper classes and methods for COM interfaces since these can be automatically generated by the Active-X Component Wizard. The generated classes can even contain methods to wrap the raw COM interface methods in such a way that they appear like normal Smalltalk methods and most external interfacing concerns (such as constructing buffers, or value holding structures, to receive the output parameters) can be ignored.

When implementing COM interfaces the function table in the interface wrapper class is used to locate the description of the arguments to methods, and again this is fairly transparent in operation. Essentially, however, the supporting technology is the same as that described in the section on External Callbacks below.

Note that it is not currently possible to overlap COM calls.