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 / licuser / licuser.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  1.9 KB  |  79 lines

  1. /*
  2.  * LICUSER.H
  3.  * Licensed Koala Object User/Client Chapter 5
  4.  *
  5.  * Definitions and structures.
  6.  *
  7.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  8.  *
  9.  * Kraig Brockschmidt, Microsoft
  10.  * Internet  :  kraigb@microsoft.com
  11.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  12.  */
  13.  
  14.  
  15. #ifndef _LICUSER_H_
  16. #define _LICUSER_H_
  17.  
  18. #define CHAPTER5
  19. #define INC_CONTROLS
  20. #include <inole.h>
  21.  
  22. //Menu Resource ID and Commands
  23. #define IDR_MENU                    1
  24.  
  25.  
  26. #define IDM_CFOBTAINCF              100
  27. #define IDM_CFOBTAINCF2             101
  28. #define IDM_CFRELEASE               102
  29. #define IDM_CFREQUESTLICKEY         103
  30. #define IDM_CLEARLICKEY             104
  31. #define IDM_CFEXIT                  105
  32.  
  33. #define IDM_OBJECTCREATEINST        200
  34. #define IDM_OBJECTCREATEINSTLIC     201
  35.  
  36.  
  37. //LICUSER.CPP
  38. LRESULT APIENTRY LicensedUserWndProc(HWND, UINT, WPARAM, LPARAM);
  39.  
  40. class CApp
  41.     {
  42.     friend LRESULT APIENTRY LicensedUserWndProc(HWND, UINT, WPARAM
  43.         , LPARAM);
  44.  
  45.     protected:
  46.         HINSTANCE       m_hInst;            //WinMain parameters
  47.         HINSTANCE       m_hInstPrev;
  48.         UINT            m_nCmdShow;
  49.  
  50.         HWND            m_hWnd;             //Main window handle
  51.         BOOL            m_fInitialized;     //Did CoInitialize work?
  52.  
  53.         BOOL            m_fLic;             //True for Lic factory
  54.         IClassFactory  *m_pIClassFac;
  55.         IClassFactory2 *m_pIClassFac2;
  56.  
  57.         BSTR            m_bstrKey;          //Licence key
  58.  
  59.     public:
  60.         CApp(HINSTANCE, HINSTANCE, UINT);
  61.         ~CApp(void);
  62.  
  63.         void ObtainClassFactory(BOOL);
  64.         void ReleaseClassFactory(BOOL);
  65.         void CreateObject(BOOL);
  66.  
  67.         BOOL Init(void);
  68.         void Message(LPTSTR);
  69.     };
  70.  
  71.  
  72. typedef CApp *PAPP;
  73.  
  74. #define CBWNDEXTRA              sizeof(PAPP)
  75. #define LICUSERWL_STRUCTURE     0
  76.  
  77.  
  78. #endif //_LICUSER_H_
  79.