home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / BOCOLE.PAK / BOLECOMP.CPP < prev    next >
C/C++ Source or Header  |  1995-08-29  |  1KB  |  49 lines

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