home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / chap05 / dkoala2 / dkoala2.h < prev    next >
C/C++ Source or Header  |  1995-05-03  |  1KB  |  57 lines

  1. /*
  2.  * DKOALA2.H
  3.  * Koala Object DLL Self-Registering Server Chapter 5
  4.  *
  5.  * Definitions, classes, and prototypes for a DLL that
  6.  * provides Koala objects to any other object user.
  7.  *
  8.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  9.  *
  10.  * Kraig Brockschmidt, Microsoft
  11.  * Internet  :  kraigb@microsoft.com
  12.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  13.  */
  14.  
  15.  
  16. #ifndef _DKOALA2_H_
  17. #define _DKOALA2_H_
  18.  
  19.  
  20. //Get the object definitions
  21. #include "koala.h"
  22.  
  23.  
  24. STDAPI DllRegisterServer(void);
  25. STDAPI DllUnregisterServer(void);
  26. BOOL   SetKeyAndValue(LPTSTR, LPTSTR, LPTSTR);
  27.  
  28. void   ObjectDestroyed(void);
  29.  
  30.  
  31. //DKOALA.CPP
  32. //This class factory object creates Koala objects.
  33.  
  34. class CKoalaClassFactory : public IClassFactory
  35.     {
  36.     protected:
  37.         ULONG           m_cRef;
  38.  
  39.     public:
  40.         CKoalaClassFactory(void);
  41.         ~CKoalaClassFactory(void);
  42.  
  43.         //IUnknown members
  44.         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
  45.         STDMETHODIMP_(ULONG) AddRef(void);
  46.         STDMETHODIMP_(ULONG) Release(void);
  47.  
  48.         //IClassFactory members
  49.         STDMETHODIMP         CreateInstance(LPUNKNOWN, REFIID
  50.                                  , PPVOID);
  51.         STDMETHODIMP         LockServer(BOOL);
  52.     };
  53.  
  54. typedef CKoalaClassFactory *PCKoalaClassFactory;
  55.  
  56. #endif //_DKOALA2_H_
  57.