home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / edkutcpp.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  2KB  |  45 lines

  1. // EdkUtCpp.h-------------------------------------------------------------------
  2. // Declares a class that supplies a list of id's and strings which can 
  3. // be found by ID.
  4. //
  5. // Copyright 1986 - 1998 Microsoft Corporation.  All Rights Reserved.
  6. // -----------------------------------------------------------------------------
  7.  
  8. #ifndef _EDKUTCPP_H_
  9. #define _EDKUTCPP_H_
  10.  
  11. // -----------------------------------------------------------------------------
  12. // Use this structure to create your list.
  13. // -----------------------------------------------------------------------------
  14.  
  15. typedef struct _IDList
  16. {
  17.     ULONG   ulID;
  18.     LPSTR   pszValue;
  19. } IDList, *PIDList;
  20.  
  21. // -----------------------------------------------------------------------------
  22.  
  23. class CIDList
  24. {
  25. public:    
  26.     // CONSTRUCTOR: Use ARRAY_CNT( IDListArray) to pass nCnt.
  27.     CIDList( 
  28.         PIDList pIDList,    // Pointer to array of IDList.
  29.         UINT nCnt);         // Number of items in the list.
  30.  
  31.     // Find an ID in the pIDList and return it's string.
  32.     const LPSTR Find(   // Returns the string found or a not found message string.
  33.         ULONG ulID);    // ID to search for.
  34.  
  35. protected:    
  36.     PIDList m_pIDList;        // Contains a ptr to the ID List array.
  37.     UINT    m_nCnt;           // Number of items in the array.
  38.     char    m_chNotFound[30]; // Will contain the last id not found message. The 
  39.                               // largest value will be "(ID: 0x012345678 not found)".
  40. };
  41.  
  42. // -----------------------------------------------------------------------------
  43.  
  44. #endif //_EDKUTCPP_H_
  45.