home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / MFC / SRC / DUMPINIT.CP_ / DUMPINIT.CP
Encoding:
Text File  |  1993-02-08  |  1.7 KB  |  57 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library. 
  2. // Copyright (C) 1992 Microsoft Corporation 
  3. // All rights reserved. 
  4. //  
  5. // This source code is only intended as a supplement to the 
  6. // Microsoft Foundation Classes Reference and Microsoft 
  7. // QuickHelp and/or WinHelp documentation provided with the library. 
  8. // See these sources for detailed information regarding the 
  9. // Microsoft Foundation Classes product. 
  10.  
  11. #include "stdafx.h"
  12.  
  13. #ifdef AFX_AUX_SEG
  14. #pragma code_seg(AFX_AUX_SEG)
  15. #endif
  16.  
  17. #ifdef _DEBUG
  18.  
  19. // If you want to route afxDump output to a different location than
  20. // the default, just copy this file to your application build directory,
  21. // modify the afxDumpFile and link the new object module into your program.
  22.  
  23. // You must have AFX.INI (from \MSVC\MFC\SRC) in your Windows 
  24. // directory if you desire diagnostic output.
  25.  
  26. // See Technical note TN007 for a description of
  27. //   afxTraceFlags and afxTraceEnabled.
  28.  
  29. #ifndef _WINDOWS
  30. static CStdioFile NEAR _afxDumpFile(stderr);
  31. CDumpContext NEAR _afxDump(&_afxDumpFile);
  32. #else
  33. static char BASED_CODE szIniFile[] = "AFX.INI";
  34. static char BASED_CODE szDiagSection[] = "Diagnostics";
  35. static char BASED_CODE szTraceEnabled[] = "TraceEnabled";
  36. static char BASED_CODE szTraceFlags[] = "TraceFlags";
  37.  
  38. CDumpContext NEAR _afxDump(NULL);
  39. #endif //!_WINDOWS
  40.  
  41. CDumpContext& NEAR afxDump = _afxDump;
  42.  
  43. extern "C" BOOL AFXAPI AfxDiagnosticInit(void)
  44. {
  45. #ifdef _WINDOWS
  46.     afxTraceEnabled = ::GetPrivateProfileInt(szDiagSection, szTraceEnabled, 
  47.         FALSE, szIniFile);
  48.     afxTraceFlags = ::GetPrivateProfileInt(szDiagSection, szTraceFlags, 
  49.         0, szIniFile);
  50. #else
  51.     afxTraceEnabled = 1; // dump to stderr by default
  52. #endif
  53.     return TRUE;
  54. }
  55.  
  56. #endif //_DEBUG
  57.