Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
870 B

  1. #ifndef __TRACE_H
  2. #define __TRACE_H
  3. typedef interface ITrace {
  4. // Data members
  5. public:
  6. private:
  7. protected:
  8. // Methods
  9. public:
  10. virtual void TraceEvent(LPCTSTR lpszFormat, ...) = 0;
  11. private:
  12. protected:
  13. } ITrace, *PITrace, **PPITrace;
  14. class CTrace : public ITrace {
  15. public:
  16. private:
  17. TCHAR m_szSourceName[256];
  18. IGenCriticalSection *m_pcs;
  19. protected:
  20. public:
  21. CTrace()
  22. {
  23. ATLTRACE(_T("CTrace::CTrace\n"));
  24. _tcscpy(m_szSourceName, _T(""));
  25. m_pcs = new CGenCriticalSection;
  26. }
  27. CTrace(LPCTSTR lpszSourceName)
  28. {
  29. ATLTRACE(_T("CTrace::CTrace\n"));
  30. _tcscpy(m_szSourceName, lpszSourceName);
  31. m_pcs = new CGenCriticalSection;
  32. }
  33. ~CTrace()
  34. {
  35. ATLTRACE(_T("CTrace::~CTrace\n"));
  36. delete m_pcs;
  37. }
  38. private:
  39. protected:
  40. virtual void TraceEvent(LPCTSTR lpszFormat, ...);
  41. };
  42. #endif // __TRACE_H