home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / BOCOLE.PAK / BOLECOMP.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.1 KB  |  45 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectComponents
  3. // Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
  4. //
  5. // $Revision:   2.2  $
  6. //
  7. //  Provides a default IUnknownMain implementation for all Bolero components 
  8. //  (helper objects and some private objects.
  9. //
  10. //    IUnknownMain is a way to create aggregatable components which support 
  11. //    IUnknown-based interfaces via multiple-inheritance. 
  12. //----------------------------------------------------------------------------
  13. #include "BOleComp.h"
  14.  
  15. ULONG _IFUNC BOleComponent::AddRefMain()
  16. {
  17.     return ++nReferences;
  18. }
  19.  
  20. ULONG _IFUNC BOleComponent::ReleaseMain()
  21. {
  22.     return --nReferences ? nReferences : (delete this, 0);
  23. }
  24.  
  25. HRESULT _IFUNC BOleComponent::QueryInterfaceMain(REFIID iid, LPVOID *ppv)
  26. {
  27.     *ppv = NULL;
  28.     return  IBUnknownMain::QueryInterfaceMain(iid, ppv);
  29. }
  30.  
  31. BOleComponent::BOleComponent(BOleClassManager *pF, IBUnknownMain *pO)
  32. {
  33.     pFactory = pF;
  34.     if (pO)
  35.         pObjOuter = pO;
  36.     else
  37.         pObjOuter = this;
  38.     nReferences = 1;
  39. }
  40.  
  41. BOleComponent::~BOleComponent()
  42. {
  43. }
  44.  
  45.