资源简介
一个小例子,环境为VS2010 能够创建Word,生成一个表,并进行表的填写
代码片段和文件信息
// DlgProxy.cpp : implementation file
//
#include “stdafx.h“
#include “WordReport.h“
#include “DlgProxy.h“
#include “WordReportDlg.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CWordReportDlgAutoProxy
IMPLEMENT_DYNCREATE(CWordReportDlgAutoProxy CCmdTarget)
CWordReportDlgAutoProxy::CWordReportDlgAutoProxy()
{
EnableAutomation();
// To keep the application running as long as an automation
// object is active the constructor calls AfxOleLockApp.
AfxOleLockApp();
// Get access to the dialog through the application‘s
// main window pointer. Set the proxy‘s internal pointer
// to point to the dialog and set the dialog‘s back pointer to
// this proxy.
ASSERT_VALID(AfxGetApp()->m_pMainWnd);
if (AfxGetApp()->m_pMainWnd)
{
ASSERT_KINDOF(CWordReportDlg AfxGetApp()->m_pMainWnd);
if (AfxGetApp()->m_pMainWnd->IsKindOf(RUNTIME_CLASS(CWordReportDlg)))
{
m_pDialog = reinterpret_cast(AfxGetApp()->m_pMainWnd);
m_pDialog->m_pAutoProxy = this;
}
}
}
CWordReportDlgAutoProxy::~CWordReportDlgAutoProxy()
{
// To terminate the application when all objects created with
// with automation the destructor calls AfxOleUnlockApp.
// Among other things this will destroy the main dialog
if (m_pDialog != NULL)
m_pDialog->m_pAutoProxy = NULL;
AfxOleUnlockApp();
}
void CWordReportDlgAutoProxy::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CCmdTarget::OnFinalRelease();
}
BEGIN_MESSAGE_MAP(CWordReportDlgAutoProxy CCmdTarget)
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CWordReportDlgAutoProxy CCmdTarget)
END_DISPATCH_MAP()
// Note: we add support for IID_IWordReport to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .IDL file.
// {8571A20C-F94F-42D2-B0EE-970BA426AC02}
static const IID IID_IWordReport =
{ 0x8571A20C 0xF94F 0x42D2 { 0xB0 0xEE 0x97 0xB 0xA4 0x26 0xAC 0x2 } };
BEGIN_INTERFACE_MAP(CWordReportDlgAutoProxy CCmdTarget)
INTERFACE_PART(CWordReportDlgAutoProxy IID_IWordReport Dispatch)
END_INTERFACE_MAP()
// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {E5A69DCF-4EE1-4171-BDCA-FBF9581AC168}
IMPLEMENT_OLECREATE2(CWordReportDlgAutoProxy “WordReport.Application“ 0xe5a69dcf 0x4ee1 0x4171 0xbd 0xca 0xfb 0xf9 0x58 0x1a 0xc1 0x68)
// CWordReportDlgAutoProxy message handlers
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 45015 2010-08-13 14:55 WordReport\WordReport\CApplication.h
文件 74718 2010-08-13 14:55 WordReport\WordReport\CDocument0.h
文件 7866 2010-08-13 14:55 WordReport\WordReport\CDocuments.h
文件 39089 2010-08-13 14:55 WordReport\WordReport\CSelection.h
文件 12134 2010-08-13 16:51 WordReport\WordReport\CTable0.h
文件 2351 2010-08-13 16:51 WordReport\WordReport\CTables0.h
文件 2677 2010-08-13 14:30 WordReport\WordReport\DlgProxy.cpp
文件 738 2010-08-13 14:30 WordReport\WordReport\DlgProxy.h
文件 5434 2010-08-13 14:30 WordReport\WordReport\ReadMe.txt
文件 67777 2009-08-31 02:31 WordReport\WordReport\res\WordReport.ico
文件 804 2010-08-13 14:30 WordReport\WordReport\res\WordReport.rc2
文件 1640 2010-08-13 14:41 WordReport\WordReport\resource.h
文件 212 2010-08-13 14:30 WordReport\WordReport\stdafx.cpp
文件 2532 2010-08-13 14:48 WordReport\WordReport\stdafx.h
文件 314 2010-08-13 14:30 WordReport\WordReport\targetver.h
文件 106108 2010-08-13 14:41 WordReport\WordReport\WordReport.aps
文件 3944 2010-08-13 14:30 WordReport\WordReport\WordReport.cpp
文件 559 2010-08-13 14:30 WordReport\WordReport\WordReport.h
文件 655 2010-08-13 14:30 WordReport\WordReport\WordReport.idl
文件 11724 2010-08-13 14:41 WordReport\WordReport\WordReport.rc
文件 725 2010-08-13 14:30 WordReport\WordReport\WordReport.reg
文件 6612 2010-08-13 16:51 WordReport\WordReport\WordReport.vcxproj
文件 2959 2010-08-13 16:51 WordReport\WordReport\WordReport.vcxproj.filters
文件 143 2010-08-13 14:30 WordReport\WordReport\WordReport.vcxproj.user
文件 10353 2011-02-22 15:32 WordReport\WordReport\WordReportDlg.cpp
文件 993 2010-08-13 14:45 WordReport\WordReport\WordReportDlg.h
文件 5360 2011-02-22 15:28 WordReport\WordReport\WordReport_h.h
文件 1968 2011-02-22 15:28 WordReport\WordReport\WordReport_i.c
文件 897 2010-08-13 14:30 WordReport\WordReport.sln
文件 6331 2011-02-22 16:35 WordReport\说明.txt
............此处省略6个文件信息
- 上一篇:基于汇编实现输入字符串并显示
- 下一篇:基于FPGA EP2C8的LCD控制器
相关资源
- FCRA认证考试_20200914.docx
- OPNET安装合集:OPNET14.5+vs2010+安装视频
- TEKLA -构件清单(净重).rpt
- UltraEdit 常用 wordfiles包
- VS2010ANDVS2010SP1.txt
- LabVIEW 2013模块和工具包报表生成与数
- 三维力控日月年报表解决方案
- VS2010 完整彻底卸载工具
- 大学计算机基础试题
- 文档密码破解神器doc、docx等
- powerDesigner 导出Word通用模板
- VS2010官方卸载工具 VS2010_Uninstall-RTM.
- corel_keygen大眼仔~旭.rar
- 一二本合并后的高考志愿模拟填报表
- 将Excel数据对应写入已做好的Word模板
- sha1sum校验算法及代码实现
- 将TXT文件转换为word文件源代码
- word2016.txt
- 2018美赛精美论文模版word版
- Echart报表实现的Demo案例
- vs2010破解版百度链接.rar
- 财务报表模板全套
- Word文件批量合并(源码)
- Springboot+freemarker生成word
- synset_words.txt
- API接口模板word/Excel
- 小恐龙公文助手
- 统计报表模板
- Demo-docx4j-word.zip
- word2vec 完整源码
评论
共有 条评论