-
大小: 2.12MB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2023-09-20
- 語(yǔ)言: C/C++
- 標(biāo)簽: VC++??WORD事件??WORD報(bào)表??
資源簡(jiǎn)介
用VC++實(shí)現(xiàn)對(duì)WORD文檔打開(kāi)、關(guān)閉等事件的監(jiān)聽(tīng)與響應(yīng)處理,將WORD編輯的內(nèi)容回傳到MFC界面中,然后在MFC界面中進(jìn)行修改,最后將內(nèi)容導(dǎo)出到WORD文檔中。

代碼片段和文件信息
#include?“stdafx.h“
#include?“AppEventListener.h“
#include?
#include?“RevCellElemnet.h“
#include?“RevTextElement.h“
//Constructor.
CAppEventListener::CAppEventListener()
{
m_refCount?=?0;
}
//Destructor.
CAppEventListener::~CAppEventListener()
{}
/******************************************************************************
*???IUnknown?Interfaces?--?All?COM?objects?must?implement?either?
*??directly?or?indirectly?the?IUnknown?interface.
******************************************************************************/?
/******************************************************************************
*??QueryInterface?--?Determines?if?this?component?supports?the?
*??requested?interface?places?a?pointer?to?that?interface?in?ppvObj?if?it?is?
*??available?and?returns?S_OK.?If?not?sets?ppvObj?to?NULL?and?returns?
*??E_NOINTERFACE.
******************************************************************************/?
STDMETHODIMP?CAppEventListener::QueryInterface(REFIID?riid?void?**?ppvObj)
{
if?(riid?==?IID_IUnknown){
*ppvObj?=?static_cast(this);
}
else?if?(riid?==?IID_IDispatch){
*ppvObj?=?static_cast(this);
}
else?if?(riid?==?IID_IApplicationEvents2){
*ppvObj?=?static_cast(this);
}
else{
*ppvObj?=?NULL;
return?E_NOINTERFACE;
}
static_cast(*ppvObj)->AddRef();
return?S_OK;
}
/******************************************************************************
*??AddRef()?--?In?order?to?allow?an?object?to?delete?itself?when?
*??it?is?no?longer?needed?it?is?necessary?to?maintain?a?count?of?all?
*??references?to?this?object.??When?a?new?reference?is?created?this?function?
*??increments?the?count.
******************************************************************************/?
STDMETHODIMP_(ULONG)?CAppEventListener::AddRef()
{
return?++m_refCount;
}
/******************************************************************************
*??Release()?--?When?a?reference?to?this?object?is?removed?this?
*??function?decrements?the?reference?count.??If?the?reference?count?is?0?
*??this?function?deletes?this?object?and?returns?0.
******************************************************************************/?
STDMETHODIMP_(ULONG)?CAppEventListener::Release()
{
m_refCount--;
if?(m_refCount?==?0)
{
delete?this;
return?0;
}
return?m_refCount;
}
/******************************************************************************
*???IDispatch?Interface?--?This?interface?allows?this?class?to?be?used?as?an
*???Automation?server?allowing?its?functions?to?be?called?by?other?COM
*???objects.
******************************************************************************/?
/******************************************************************************
*???GetTypeInfoCount?--?This?function?determines?if?the?class?supports?type?
*???information?interfaces?or?not.?It?places?1?in?iTInfo?if?the?class?supports
*
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????2053833??2014-08-30?13:06??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\C++實(shí)現(xiàn)WORD事件捕獲與編輯處理.exe
?????文件??????20842??2014-08-30?14:27??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\c++實(shí)現(xiàn)WORD事件捕獲及編輯處理說(shuō)明.docx
?????文件??????13156??2014-08-29?18:15??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\AppEventListener.cpp
?????文件???????1753??2014-08-30?13:09??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\AppEventListener.h
?????文件????1358115??2013-10-11?11:31??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\msword.cpp
?????文件?????428691??2013-10-11?11:41??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\msword.h
?????文件???????3198??2014-08-20?12:17??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\ReadMe.txt
????.......?????67777??2009-08-31?02:31??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\res\WordEvent1.ico
?????文件????????676??2014-08-20?12:17??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\res\WordEvent1.rc2
?????文件???????1826??2014-08-28?16:32??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\resource.h
?????文件????????440??2014-08-29?16:07??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\RevCellElemnet.cpp
?????文件????????300??2014-08-29?16:22??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\RevCellElemnet.h
?????文件????????332??2014-08-29?16:06??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\RevTextElement.cpp
?????文件????????235??2014-08-29?16:22??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\RevTextElement.h
?????文件????????174??2014-08-29?18:33??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\stdafx.cpp
?????文件???????1691??2014-08-29?18:33??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\stdafx.h
?????文件????????234??2014-08-20?12:17??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\targetver.h
?????文件?????105924??2014-08-29?19:02??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\WordEvent1.aps
?????文件???????2045??2014-08-20?12:17??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\WordEvent1.cpp
?????文件????????466??2014-08-20?12:17??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\WordEvent1.h
?????文件??????10902??2014-08-29?19:02??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\WordEvent1.rc
?????文件???????6310??2014-08-22?10:18??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\WordEvent1.vcxproj
?????文件???????2773??2014-08-22?10:18??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\WordEvent1.vcxproj.filters
?????文件????????222??2014-08-20?13:06??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\WordEvent1.vcxproj.user
?????文件??????15806??2014-08-30?12:59??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\WordEvent1Dlg.cpp
?????文件???????1560??2014-08-30?12:57??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1\WordEvent1Dlg.h
?????文件????????897??2014-08-20?12:17??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1.sln
????..A..H.?????24576??2014-08-30?14:28??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WordEvent1.suo
?????文件??????11652??2014-08-30?13:05??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\WORD交互操作報(bào)表.docx
?????文件??????12375??2013-10-24?14:35??c++實(shí)現(xiàn)WORD事件處理與報(bào)表輸出\WordEvent1\學(xué)生信息.dotx
............此處省略9個(gè)文件信息
評(píng)論
共有 條評(píng)論