home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / edkutcpp.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  1.7 KB  |  47 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. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  10. #define _EDKUTCPP_H_
  11.  
  12. // -----------------------------------------------------------------------------
  13. // Use this structure to create your list.
  14. // -----------------------------------------------------------------------------
  15.  
  16. typedef struct _IDList
  17. {
  18.     ULONG   ulID;
  19.     LPSTR   pszValue;
  20. } IDList, *PIDList;
  21.  
  22. // -----------------------------------------------------------------------------
  23.  
  24. class CIDList
  25. {
  26. public:    
  27.     // CONSTRUCTOR: Use ARRAY_CNT( IDListArray) to pass nCnt.
  28.     CIDList( 
  29.         PIDList pIDList,    // Pointer to array of IDList.
  30.         UINT nCnt);         // Number of items in the list.
  31.  
  32.     // Find an ID in the pIDList and return it's string.
  33.     const LPSTR Find(   // Returns the string found or a not found message string.
  34.         ULONG ulID);    // ID to search for.
  35.  
  36. protected:    
  37.     PIDList m_pIDList;        // Contains a ptr to the ID List array.
  38.     UINT    m_nCnt;           // Number of items in the array.
  39.     char    m_chNotFound[30]; // Will contain the last id not found message. The 
  40.                               // largest value will be "(ID: 0x012345678 not found)".
  41. };
  42.  
  43. // -----------------------------------------------------------------------------
  44.  
  45. #pragma option pop /*P_O_Pop*/
  46. #endif //_EDKUTCPP_H_
  47.