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 / chap02 / query / query.h < prev    next >
C/C++ Source or Header  |  1995-05-03  |  2KB  |  71 lines

  1. /*
  2.  * QUERY.H
  3.  * QueryInterface and Multiple Interface Sample, Chapter 2
  4.  *
  5.  * Definitions, classes, and prototypes
  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 _QUERY_H_
  16. #define _QUERY_H_
  17.  
  18. #define CHAPTER2
  19. #include <inole.h>
  20.  
  21. #ifndef RC_INVOKED
  22. #include "interfac.h"
  23. #include "object1.h"
  24. #include "object2.h"
  25. #include "object3.h"
  26. #endif
  27.  
  28. //Menu Resource ID and Commands
  29. #define IDR_MENU                    1
  30.  
  31. #define IDM_OBJECTCREATE1           100
  32. #define IDM_OBJECTCREATE2           101
  33. #define IDM_OBJECTCREATE3           102
  34. #define IDM_OBJECTRELEASE           103
  35. #define IDM_OBJECTGETMESSAGE        104
  36. #define IDM_OBJECTGETSTRING         105
  37. #define IDM_OBJECTEXIT              106
  38.  
  39.  
  40. //QUERY.CPP
  41. LRESULT APIENTRY QueryWndProc(HWND, UINT, WPARAM, LPARAM);
  42.  
  43. class CApp
  44.     {
  45.     friend LRESULT APIENTRY QueryWndProc(HWND, UINT, WPARAM, LPARAM);
  46.  
  47.     protected:
  48.         HINSTANCE       m_hInst;            //WinMain parameters
  49.         HINSTANCE       m_hInstPrev;
  50.         UINT            m_nCmdShow;
  51.  
  52.         HWND            m_hWnd;             //Main window handle
  53.         IUnknown       *m_pIUnknown;        //Current object
  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 QUERYWL_STRUCTURE   0
  68.  
  69.  
  70. #endif //_QUERY_H_
  71.