home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / include / MemDump.h < prev    next >
C/C++ Source or Header  |  2000-05-11  |  2KB  |  42 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   : memdump.h                                                             //
  12. //  Description: Memory dumper                                                       //
  13. //  Version    : 1.00.000, May 31, 2000                                              //
  14. //-----------------------------------------------------------------------------------//
  15.  
  16. class ofstream;
  17.  
  18. class KMemDump
  19. {
  20.     TCHAR    m_filename[MAX_PATH];
  21.  
  22.     ofstream * m_stream;
  23.  
  24. public:
  25.     TCHAR    m_line[128];
  26.     
  27.     void OpenDump(void);
  28.     void CloseDump(void);
  29.  
  30.     void DumpLine(unsigned char * p, unsigned offset, int unitsize);
  31.     void Dump(unsigned char * start, unsigned offset, int size, int unitsize);
  32.     void Newline(void);
  33.     void Writeln(const TCHAR * text);
  34.     
  35.     KMemDump()
  36.     {
  37.         m_stream = NULL;
  38.     }
  39. };
  40.  
  41.  
  42.