Micron Electronics.  We help you get it done.

PC Magazine

  PC Tech

COM Objects in Delphi, Part 1

Introduction

COM object essentials

Satellites and Containers

Satellite objects

Container objects

The Class Factory

GUIDs, CLSIDs, and IIDs

Figure 1

 
  Categories:
Programming
COM Objects in Delphi, Part 1
Satellite objects

Continued from Satellites and Containers

The ISatelliteUnknown object type descends directly from the supplied IUnknown type and necessarily overrides the abstract methods corresponding to the three IUnknown functions. ISatelliteUnknown has a single protected data field called FContainer, of type IContainerUnknown (defined below), which is initialized in its Create constructor. The implementations for the three IUnknown functions simply return the result of calling the corresponding method in the container object. Depending on which interface it has requested, the calling program may gain access to the QueryInterface, AddRef, and Release functions directly through the container object or through any of its satellite objects.

If you've read much OLE literature, you'll realize that the names used in Figure 1 for the parameters to QueryInterface in the DelphCOM unit shown here are nonstandard. Usually the parameter representing the ID of the desired interface is named riid, and the parameter representing the returned object is called ppv. Since the names of the parameters have no significance outside of the object, I have replaced the cryptic standard names with the more intelligible WantIID and ReturnedObject.

Continues...

Published as Power Programming in the 01/07/97 issue of PC Magazine.


 SPONSORED LINKS
Finance   Save now, save later - 9.99% Visa card - NOT an intro rate.
Shopping   Buy a 56K modem for $19.95 after rebate from NetMarket!
Software   X10.com -- The SuperSite for Home Automation
 ZDNET FEATURED LINKS
Freeware   It's a software free for all - 100 FREE downloads!
Contests   Enter to win a FREE multimedia PC from ZDNet!
 MAGAZINE OFFERS
Free Trial   Try the next issue of Computer Gaming World FREE!

TOP
Copyright (c) 1997 Ziff-Davis Inc.