home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / include / Lookup.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-11  |  1.6 KB  |  35 lines

  1. #pragma once
  2.  
  3. //-----------------------------------------------------------------------------------//
  4. //              Windows Graphics Programming: Win32 GDI and DirectDraw               //
  5. //                             ISBN  0-13-086985-6                                   //
  6. //                                                                                   //
  7. //  Written            by  Yuan, Feng                             www.fengyuan.com   //
  8. //  Copyright (c) 2000 by  Hewlett-Packard Company                www.hp.com         //
  9. //  Published          by  Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com      //
  10. //                                                                                   //
  11. //  FileName   : lookup.h                                                             //
  12. //  Description: index to string mapping                                             //
  13. //  Version    : 1.00.000, May 31, 2000                                              //
  14. //-----------------------------------------------------------------------------------//
  15.  
  16. typedef struct
  17.     unsigned      key;
  18.     unsigned long mask;
  19.     const TCHAR * name;
  20. } DicItem;
  21.  
  22.  
  23. #define twin(name)            { name, 0xffffffff, TEXT(#name) }
  24. #define pair(name)            { name, 0xffffffff, TEXT(#name) }
  25. #define item(key, name)     { key,  0xffffffff, name        }
  26. #define tripod(name, mask)  { name, mask,       TEXT(#name) }
  27. #define dummyitem           { 0,    0xffffffff, NULL        }
  28.  
  29. bool         Lookup(unsigned index, const DicItem *dic, TCHAR * szResult);
  30. const TCHAR *Lookup(unsigned index, const DicItem *dic);
  31.  
  32. unsigned     Decode(const TCHAR *item, const DicItem *dic);
  33.  
  34.