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

  1. /*
  2.  * LINKUSER.H
  3.  * Link User Chapter 9
  4.  *
  5.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  6.  *
  7.  * Kraig Brockschmidt, Microsoft
  8.  * Internet  :  kraigb@microsoft.com
  9.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  10.  */
  11.  
  12.  
  13. #ifndef _LINKUSER_H_
  14. #define _LINKUSER_H_
  15.  
  16. #define INC_OLE2
  17. #define CHAPTER9
  18. #include <inole.h>
  19. #include <idescrip.h>
  20.  
  21. //Menu Resource ID and Commands
  22. #define IDR_MENU                    1
  23.  
  24.  
  25. #define IDM_LINKSHOWDESCRIPTION     100
  26. #define IDM_LINKPARSEANDBIND        101
  27. #define IDM_LINKEXIT                102
  28.  
  29.  
  30. //LINKUSER.CPP
  31. LRESULT APIENTRY LinkUserWndProc(HWND, UINT, WPARAM, LPARAM);
  32.  
  33.  
  34. class CAdviseSink;
  35. typedef class CAdviseSink *PCAdviseSink;
  36.  
  37.  
  38. /*
  39.  * Application-defined classes and types.
  40.  */
  41.  
  42. #define CMONIKERS       3
  43. #define ID_LISTOLINKS   1000
  44.  
  45.  
  46. class CApp
  47.     {
  48.     friend LRESULT APIENTRY LinkUserWndProc(HWND, UINT, WPARAM
  49.         , LPARAM);
  50.  
  51.     protected:
  52.         HINSTANCE       m_hInst;            //WinMain parameters
  53.         HINSTANCE       m_hInstPrev;
  54.         UINT            m_nCmdShow;
  55.  
  56.         HWND            m_hWnd;             //Main window handle
  57.         BOOL            m_fInitialized;     //Did CoInitialize work?
  58.  
  59.         HWND            m_hWndList;         //Listbox display
  60.         IMoniker       *m_rgpmk[CMONIKERS]; //Held monikers
  61.  
  62.     public:
  63.         CApp(HINSTANCE, HINSTANCE, UINT);
  64.         ~CApp(void);
  65.         BOOL Init(void);
  66.  
  67.         BOOL CreateMonikers(void);
  68.         BOOL ListInitialize(void);
  69.         void ShowDescription(void);
  70.         void ParseAndBind(void);
  71.         void BindAndShow(IMoniker *, IBindCtx *);
  72.     };
  73.  
  74.  
  75. typedef CApp *PAPP;
  76.  
  77. #define CBWNDEXTRA               sizeof(PAPP)
  78. #define LINKUSERWL_STRUCTURE     0
  79.  
  80.  
  81. #endif //_LINKUSER_H_
  82.