home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / numega / sc501.exe / data1.cab / Examples / IUNKNOWN.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-25  |  1.6 KB  |  63 lines

  1. /*
  2.  * IUnknown.h
  3.  * $Header: /bcsample/IFACEDLL/IUNKNOWN.H 1     5/28/96 1:12p Dave $
  4.  *
  5.  * Description:
  6.  *  The base declartion of the IUnknown interface implementation class.
  7.  *
  8.  * Notes:
  9.  *  <implementation notes go here>
  10.  *
  11.  ***********************************************************************
  12.  *
  13.  * NuMega Technologies, Inc.
  14.  * P.O. Box 7780
  15.  * Nashua, NH 03060
  16.  *
  17.  * (c) Copyright 1994, 1995, 1996 NuMega Technologies, Inc.
  18.  * ALL RIGHTS RESERVED.
  19.  *
  20.  ***********************************************************************
  21.  *
  22.  **********************************************************************/
  23.  
  24. /*----------------------------------------------------------------------
  25. DISCUSSION  :
  26.     The base IUnknown implementation for the project.
  27. ----------------------------------------------------------------------*/
  28. #ifndef _IUNKNOWN_H
  29. #define _IUNKNOWN_H
  30.  
  31. #include "IQueryI.h"
  32.  
  33.  
  34. class CIUnknown : public IUnknown
  35. {
  36. protected   :
  37.     // Object reference count
  38.     ULONG           m_cRef          ;
  39.     // Controlling unknown
  40.     LPUNKNOWN       m_pUnkOuter     ;
  41.     // To call on closure
  42.     PFNDESTROYED    m_pfnDestroy    ;
  43.  
  44.     // The table of interfaces we support
  45.     PCInternalQuery m_pInterfaceTable[ 100 ] ;
  46.  
  47. public      :
  48.     CIUnknown ( LPUNKNOWN pUnkOuter , PFNDESTROYED pfnDestroy ) ;
  49.     ~CIUnknown ( void ) ;
  50.  
  51.     BOOL Init ( void ) ;
  52.  
  53.     //Non-delegating object IUnknown
  54.     STDMETHODIMP QueryInterface ( REFIID , PPVOID ) ;
  55.     STDMETHODIMP_( ULONG ) AddRef ( void ) ;
  56.     STDMETHODIMP_( ULONG ) Release ( void ) ;
  57.  
  58. } ;
  59.  
  60. typedef CIUnknown * PCIUnknown ;
  61.  
  62. #endif      // _IUNKNOWN_H
  63.