BRKPNTS.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:3k
源码类别:

Windows编程

开发平台:

Visual C++

  1. // BrkPnts.h : Declaration of the CBrkPnts
  2. #ifndef __BRKPNTS_H_
  3. #define __BRKPNTS_H_
  4. #include "DlgBrkPnts.h" // Added by ClassView
  5. #include "resource.h"       // main symbols
  6. #include <ObjModeladdguid.h>
  7. #include <ObjModelappguid.h>
  8. #include <ObjModelbldguid.h>
  9. #include <ObjModeltextguid.h>
  10. #include <ObjModeldbgguid.h>
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CBrkPnts
  13. class ATL_NO_VTABLE CBrkPnts : 
  14. public CComObjectRootEx<CComSingleThreadModel>,
  15. public CComCoClass<CBrkPnts, &CLSID_BrkPnts>,
  16. public IDispatchImpl<IApplicationEvents, &IID_IApplicationEvents, &LIBID_BRKPNTMGRLib>,
  17. public IDispatchImpl<IDebuggerEvents, &IID_IDebuggerEvents, &LIBID_BRKPNTMGRLib>,
  18. public IDSAddIn,
  19. public IDispatchImpl<IBrkPnts, &IID_IBrkPnts, &LIBID_BRKPNTMGRLib>
  20. {
  21. public:
  22. CBrkPnts();
  23. ~CBrkPnts();
  24. HRESULT GetBrkPnts();
  25. DECLARE_REGISTRY_RESOURCEID(IDR_BRKPNTS)
  26. BEGIN_COM_MAP(CBrkPnts)
  27. COM_INTERFACE_ENTRY_IID(IID_IBrkPnts, IBrkPnts)
  28. COM_INTERFACE_ENTRY2(IDispatch, IBrkPnts)
  29. COM_INTERFACE_ENTRY_IID(IID_IDSAddIn, IDSAddIn)
  30. COM_INTERFACE_ENTRY_IID(IID_IApplicationEvents, IApplicationEvents)
  31. COM_INTERFACE_ENTRY_IID(IID_IDebuggerEvents, IDebuggerEvents)
  32. END_COM_MAP()
  33. CComPtr<IApplication> m_spApplication;
  34. CComPtr<IDispatch> m_pDispBrkPnts;
  35. CComQIPtr<IBreakpoints, &IID_IBreakpoints> m_pBrkPnts;
  36. DWORD m_dwAddInID;
  37. DWORD m_dwAppEvents;
  38. DWORD m_dwDbgEvents;
  39. // IDSAddIn methods
  40. public:
  41. STDMETHOD(OnConnection)(IApplication* pApp, VARIANT_BOOL bFirstTime, long dwCookie, VARIANT_BOOL* bOnConnection);
  42. STDMETHOD(OnDisconnection)(VARIANT_BOOL bLastTime);
  43. // IApplicationEvents methods
  44. public:
  45. STDMETHOD(BeforeBuildStart)();
  46. STDMETHOD(BuildFinish)(long nNumErrors, long nNumWarnings);
  47. STDMETHOD(BeforeApplicationShutDown)();
  48. STDMETHOD(DocumentOpen)(IDispatch *pDocument);
  49. STDMETHOD(BeforeDocumentClose)(IDispatch *pDocument);
  50. STDMETHOD(DocumentSave)(IDispatch *pDocument);
  51. STDMETHOD(NewDocument)(IDispatch *pDocument);
  52. STDMETHOD(WindowActivate)(IDispatch *pWindow);
  53. STDMETHOD(WindowDeactivate)(IDispatch *pWindow);
  54. STDMETHOD(WorkspaceOpen)();
  55. STDMETHOD(WorkspaceClose)();
  56. STDMETHOD(NewWorkspace)();
  57. // IDebuggerEvents method
  58. public:
  59.     STDMETHOD(BreakpointHit)(IDispatch *pBreakpoint);
  60. // IBrkPnts
  61. public:
  62. void GetCounts(long &lTotal, long &lEnabled);
  63. void SetFile(LPCTSTR szFile);
  64. void SetSaveOnlyEnabled(BOOL fSaveOnlyEnabled);
  65. HRESULT ClearAll();
  66. HRESULT FindDoc(LPCTSTR szFile, CComPtr<IGenericDocument>& pDoc, BOOL fOkToOpen = TRUE);
  67. HRESULT Save(BOOL fToOutputWindow, LPCTSTR szFile, BOOL fSaveOnlyEnabled, CString& strComment);
  68. HRESULT Load(LPCTSTR szFile, CString& strComment);
  69. STDMETHOD(BrkPntMgr)();
  70. protected:
  71. BOOL m_fSaveOnlyEnabled;
  72. CString m_strFile;
  73. BOOL m_fOutputWnd;
  74. };
  75. #endif //__BRKPNTS_H_