AGCWinApp.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. #ifndef __AGCWinApp_h__
  3. #define __AGCWinApp_h__
  4. /////////////////////////////////////////////////////////////////////////////
  5. // AGCWinApp.h : Declaration of the CAGCWinApp class.
  6. //
  7. #include <AGC.h>
  8. #include <..\TCLib\WinApp.h>
  9. /////////////////////////////////////////////////////////////////////////////
  10. //
  11. class CAGCWinApp : public TCWinAppDLL
  12. {
  13. // Attributes
  14. public:
  15. void SetDebugHook(IAGCDebugHook* pdh)
  16. {
  17. m_spDebugHook = pdh;
  18. }
  19. // Overrides
  20. public:
  21. #ifdef _DEBUG
  22. virtual void DebugOutput(const char* psz)
  23. {
  24. if (NULL != m_spDebugHook)
  25. m_spDebugHook->DebugOutput(psz);
  26. else
  27. TCWinAppDLL::DebugOutput(psz);
  28. }
  29. virtual bool OnAssert(const char* psz, const char* pszFile, int line, const char* pszModule)
  30. {
  31. return (NULL != m_spDebugHook) ?
  32. !!m_spDebugHook->OnAssert(psz, pszFile, line, pszModule) :
  33. TCWinAppDLL::OnAssert(psz, pszFile, line, pszModule);
  34. }
  35. virtual void OnAssertBreak()
  36. {
  37. if (NULL != m_spDebugHook)
  38. m_spDebugHook->OnAssertBreak();
  39. else
  40. TCWinAppDLL::OnAssertBreak();
  41. }
  42. #endif // _DEBUG
  43. // Data Members
  44. protected:
  45. IAGCDebugHookPtr m_spDebugHook;
  46. };
  47. /////////////////////////////////////////////////////////////////////////////
  48. // External Reference
  49. extern CAGCWinApp g_app;
  50. /////////////////////////////////////////////////////////////////////////////
  51. #endif // !__AGCWinApp_h__