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

  1. /*
  2.  * OBJUSER.H
  3.  * 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 _OBJUSER_H_
  16. #define _OBJUSER_H_
  17.  
  18. #define CHAPTER5
  19. #include <inole.h>
  20.  
  21. //Menu Resource ID and Commands
  22. #define IDR_MENU                    1
  23.  
  24.  
  25. #define IDM_OBJECTUSEDLL            100
  26. #define IDM_OBJECTUSEEXE            101
  27. #define IDM_OBJECTCREATECOGCO       102
  28. #define IDM_OBJECTCREATECOCI        103
  29. #define IDM_OBJECTADDREF            104
  30. #define IDM_OBJECTRELEASE           105
  31. #define IDM_OBJECTEXIT              106
  32.  
  33.  
  34.  
  35. //OBJUSER.CPP
  36. LRESULT APIENTRY ObjectUserWndProc(HWND, UINT, WPARAM, LPARAM);
  37.  
  38. class CApp
  39.     {
  40.     friend LRESULT APIENTRY ObjectUserWndProc(HWND, UINT, WPARAM
  41.         , LPARAM);
  42.  
  43.     protected:
  44.         HINSTANCE       m_hInst;            //WinMain parameters
  45.         HINSTANCE       m_hInstPrev;
  46.         UINT            m_nCmdShow;
  47.  
  48.         HWND            m_hWnd;             //Main window handle
  49.         BOOL            m_fEXE;             //Menu selection
  50.  
  51.         ULONG           m_cRefOurs;         //Our use of the object
  52.         LPUNKNOWN       m_pIUnknown;        //IUnknown interface
  53.         BOOL            m_fInitialized;     //Did CoInitialize work?
  54.  
  55.     public:
  56.         CApp(HINSTANCE, HINSTANCE, UINT);
  57.         ~CApp(void);
  58.  
  59.         BOOL Init(void);
  60.         void Message(LPTSTR);
  61.     };
  62.  
  63.  
  64. typedef CApp *PAPP;
  65.  
  66. #define CBWNDEXTRA              sizeof(PAPP)
  67. #define OBJUSERWL_STRUCTURE     0
  68.  
  69.  
  70. #endif //_OBJUSER_H_
  71.