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

  1. /*
  2.  * AUTOCLI.H
  3.  * Automation Client Chapter 15
  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. #ifndef _AUTOCLI_H_
  15. #define _AUTOCLI_H_
  16.  
  17. #define INC_AUTOMATION
  18. #define CHAPTER14
  19. #define CHAPTER15
  20. #include <inole.h>
  21. #include <shellapi.h>
  22. #include <malloc.h>
  23.  
  24. //Menu Resource ID and Commands
  25. #define IDR_MENU                    1
  26.  
  27. #define IDM_GETSOUND                0x0001
  28. #define IDM_BEEP                    0x0002
  29. #define IDM_EXIT                    0x0003
  30.  
  31. //These match MB_* identifiers for MessageBeep
  32. #define IDM_SETSOUNDDEFAULT         0x0008
  33. #define IDM_SETSOUNDHAND            0x0010
  34. #define IDM_SETSOUNDQUESTION        0x0020
  35. #define IDM_SETSOUNDEXCLAMATION     0x0030
  36. #define IDM_SETSOUNDASTERISK        0x0040
  37.  
  38. #define IDM_SETSOUNDBOGUS           0x0555
  39.  
  40.  
  41. //Stringtable IDs
  42. #define CCHSTRINGMAX                80
  43. #define IDS_MESSAGEEXCEPTION        0
  44. #define IDS_MESSAGEEXCEPTIONSCODE   1
  45. #define IDS_MESSAGEUNKNOWNEXCEPTION 2
  46.  
  47.  
  48. //AUTOCLI.CPP
  49. LRESULT APIENTRY AutoClientWndProc(HWND, UINT, WPARAM, LPARAM);
  50. void HelpDirFromCLSID(CLSID, LPTSTR);
  51.  
  52. class CApp
  53.     {
  54.     friend LRESULT APIENTRY AutoClientWndProc(HWND, UINT, WPARAM
  55.         , LPARAM);
  56.  
  57.     protected:
  58.         HINSTANCE       m_hInst;            //WinMain parameters
  59.         HINSTANCE       m_hInstPrev;
  60.         UINT            m_nCmdShow;
  61.  
  62.         HWND            m_hWnd;             //Main window handle
  63.         BOOL            m_fInitialized;     //Did CoInitialize work?
  64.         LCID            m_lcid;             //User locale
  65.         TCHAR           m_szHelpDir[256];   //Object's help directory
  66.         IDispatch      *m_pIDispatch;       //Interface we use
  67.  
  68.     public:
  69.         CApp(HINSTANCE, HINSTANCE, UINT);
  70.         ~CApp(void);
  71.  
  72.         BOOL    Init(void);
  73.         HRESULT NameToID(OLECHAR *, DISPID *);
  74.         HRESULT Invoke(DISPID, WORD, DISPPARAMS *, VARIANT *
  75.                     , EXCEPINFO *, UINT *);
  76.         void    Message(LPTSTR);
  77.         UINT    Message(LPTSTR, UINT);
  78.     };
  79.  
  80.  
  81. typedef CApp *PCApp;
  82.  
  83. #define CBWNDEXTRA              sizeof(PCApp)
  84. #define AUTOCLIWL_STRUCTURE     0
  85.  
  86.  
  87. #endif //_AUTOCLI_H_
  88.