1 // Commands.h : header file
4 #if !defined(AFX_COMMANDS_H__AC726717_2977_11D1_B2F3_006008040780__INCLUDED_)
5 #define AFX_COMMANDS_H__AC726717_2977_11D1_B2F3_006008040780__INCLUDED_
10 public CComDualImpl
< ICommands
,
13 public CComObjectRoot
,
14 public CComCoClass
< CCommands
,
18 IApplication
* m_pApplication
;
23 void SetApplicationObject (IApplication
* m_pApplication
);
24 IApplication
*GetApplicationObject ()
26 return m_pApplication
;
28 void UnadviseFromEvents ();
30 BEGIN_COM_MAP (CCommands
)
31 COM_INTERFACE_ENTRY (IDispatch
)
32 COM_INTERFACE_ENTRY (ICommands
)
34 DECLARE_NOT_AGGREGATABLE (CCommands
)
37 // This class template is used as the base class for the Application
38 // event handler object and the Debugger event handler object,
39 // which are declared below.
40 template < class IEvents
,
41 const IID
* piidEvents
,
44 const CLSID
* pClsidEvents
>
46 public CComDualImpl
< IEvents
,
49 public CComObjectRoot
,
50 public CComCoClass
< XEvents
,
54 BEGIN_COM_MAP (XEvents
)
55 COM_INTERFACE_ENTRY (IDispatch
)
56 COM_INTERFACE_ENTRY_IID (*piidEvents
, IEvents
)
58 DECLARE_NOT_AGGREGATABLE (XEvents
)
59 void Connect (IUnknown
* pUnk
)
61 VERIFY (SUCCEEDED (AtlAdvise (pUnk
, this, *piidEvents
,
64 void Disconnect (IUnknown
* pUnk
)
66 AtlUnadvise (pUnk
, *piidEvents
, m_dwAdvise
);
69 CCommands
*m_pCommands
;
75 // This object handles events fired by the Application object
76 class XApplicationEvents
: public XEventHandler
< IApplicationEvents
,
77 &IID_IApplicationEvents
,
80 &CLSID_ApplicationEvents
>
83 // IApplicationEvents methods
84 STDMETHOD (BeforeBuildStart
) (THIS
);
85 STDMETHOD (BuildFinish
) (THIS_
long nNumErrors
, long nNumWarnings
);
86 STDMETHOD (BeforeApplicationShutDown
) (THIS
);
87 STDMETHOD (DocumentOpen
) (THIS_ IDispatch
* theDocument
);
88 STDMETHOD (BeforeDocumentClose
) (THIS_ IDispatch
* theDocument
);
89 STDMETHOD (DocumentSave
) (THIS_ IDispatch
* theDocument
);
90 STDMETHOD (NewDocument
) (THIS_ IDispatch
* theDocument
);
91 STDMETHOD (WindowActivate
) (THIS_ IDispatch
* theWindow
);
92 STDMETHOD (WindowDeactivate
) (THIS_ IDispatch
* theWindow
);
93 STDMETHOD (WorkspaceOpen
) (THIS
);
94 STDMETHOD (WorkspaceClose
) (THIS
);
95 STDMETHOD (NewWorkspace
) (THIS
);
97 typedef CComObject
< XApplicationEvents
> XApplicationEventsObj
;
98 XApplicationEventsObj
*m_pApplicationEventsObj
;
100 // This object handles events fired by the Application object
101 class XDebuggerEvents
: public XEventHandler
< IDebuggerEvents
,
102 &IID_IDebuggerEvents
,
105 &CLSID_DebuggerEvents
>
108 // IDebuggerEvents method
109 STDMETHOD (BreakpointHit
) (THIS_ IDispatch
* pBreakpoint
);
111 typedef CComObject
< XDebuggerEvents
> XDebuggerEventsObj
;
112 XDebuggerEventsObj
*m_pDebuggerEventsObj
;
116 STDMETHOD (VisVimDialog
) (THIS
);
117 STDMETHOD (VisVimEnable
) (THIS
);
118 STDMETHOD (VisVimDisable
) (THIS
);
119 STDMETHOD (VisVimToggle
) (THIS
);
120 STDMETHOD (VisVimLoad
) (THIS
);
123 typedef CComObject
< CCommands
> CCommandsObj
;
125 //{{AFX_INSERT_LOCATION}}
127 #endif // !defined(AFX_COMMANDS_H__AC726717_2977_11D1_B2F3_006008040780__INCLUDED)