WordEventSink.h
资源名称:wordauto.zip [点击查看]
上传用户:fda_625
上传日期:2007-01-02
资源大小:32k
文件大小:2k
源码类别:
文件操作
开发平台:
Visual C++
- #if !defined(AFX_WORDEVENTSINK_H__F45A8330_C1E9_11D2_A0C4_0080C7F3B56B__INCLUDED_)
- #define AFX_WORDEVENTSINK_H__F45A8330_C1E9_11D2_A0C4_0080C7F3B56B__INCLUDED_
- /*----------------------------------------------------------------------------*/
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- /*----------------------------------------------------------------------------*/
- #pragma warning (disable:4146)
- #import "mso97.dll"
- #pragma warning (default:4146)
- #import "vbeext1.olb"
- #import "msword8.olb" rename("ExitWindows", "WordExitWindows")
- #include "ConnectionAdvisor.h"
- class CTestDlg;
- /*----------------------------------------------------------------------------*/
- const IID IID_IWordAppEventSink = __uuidof(Word::ApplicationEvents);
- const IID IID_IWordDocEventSink = __uuidof(Word::DocumentEvents);
- /*----------------------------------------------------------------------------*/
- class CWordEventSink : public CCmdTarget
- {
- DECLARE_DYNCREATE(CWordEventSink)
- public:
- CWordEventSink();
- virtual ~CWordEventSink();
- BOOL Advise(IUnknown* pSource, REFIID iid);
- BOOL Unadvise(REFIID iid);
- void SetLauncher(CTestDlg* pWordLauncher);
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CWordEventSink)
- public:
- virtual void OnFinalRelease();
- //}}AFX_VIRTUAL
- protected:
- // Generated message map functions
- //{{AFX_MSG(CWordEventSink)
- // NOTE - the ClassWizard will add and remove member functions here.
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- // Generated OLE dispatch map functions
- //{{AFX_DISPATCH(CWordEventSink)
- afx_msg void OnAppStartup();
- afx_msg void OnAppQuit();
- afx_msg void OnAppDocumentChange();
- afx_msg void OnDocNew();
- afx_msg void OnDocOpen();
- afx_msg void OnDocClose();
- //}}AFX_DISPATCH
- DECLARE_DISPATCH_MAP()
- DECLARE_INTERFACE_MAP()
- private:
- CConnectionAdvisor m_AppEventsAdvisor;
- CConnectionAdvisor m_DocEventsAdvisor;
- CTestDlg* m_pWordLauncher;
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_WORDEVENTSINK_H__F45A8330_C1E9_11D2_A0C4_0080C7F3B56B__INCLUDED_)