资源简介
VC6补丁FileTool。博客地址:http://blog.csdn.net/bingdianlanxin,有问题欢迎留言!

代码片段和文件信息
// Commands.cpp : implementation file
//
#include “stdafx.h“
#include “FileTool.h“
#include “Commands.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCommands
CCommands::CCommands()
{
m_pApplication = NULL;
}
CCommands::~CCommands()
{
ASSERT (m_pApplication != NULL);
m_pApplication->Release();
}
void CCommands::SetApplicationobject(IApplication* pApplication)
{
// This function assumes pApplication has already been AddRef‘d
// for us which CDSAddIn did in its QueryInterface call
// just before it called us.
m_pApplication = pApplication;
}
/////////////////////////////////////////////////////////////////////////////
// CCommands methods
STDMETHODIMP CCommands::AddFileToProject()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// TODO: Replace this with the actual code to execute this command
// Use m_pApplication to access the Developer Studio Application object
// and VERIFY_OK to see error strings in DEBUG builds of your add-in
// (see stdafx.h)
VERIFY_OK(m_pApplication->EnableModeless(VARIANT_FALSE));
HRESULT hr;
CComPtr m_pDispatch(NULL);
hr=m_pApplication->get_Projects(&m_pDispatch);
if(FAILED(hr))
{
AfxMessageBox(“Unable to obtain the IProject‘s pointer“);
return S_FALSE;
}
CComQIPtr m_Project(m_pDispatch);
long count;
hr=m_Project->get_Count(&count);
if(FAILED(hr))
{
AfxMessageBox(“Unable to obtain the number of projects in the workspace“);
return S_FALSE;
}
if(count > 0)
{
CFileDialog AddFiles(TRUE);
AddFiles.m_ofn.lpstrtitle = “Add Files To Project“;
AddFiles.m_ofn.lpstrFilter = “All Files(*.*)\0*.*\0\0“;
AddFiles.m_ofn.Flags = AddFiles.m_ofn.Flags | OFN_ALLOWMULTISELECT;
char test[2000];
test[0]=‘\0‘;
AddFiles.m_ofn.lpstrFile = test;
AddFiles.m_ofn.nMaxFile = 2000;
if(AddFiles.DoModal() == IDOK)
{
POSITION position=AddFiles.GetStartPosition();
CString file_name;
m_pDispatch=NULL;
hr=m_pApplication->get_ActiveProject(&m_pDispatch);
if(FAILED(hr))
{
AfxMessageBox(“Unable to obtain the ActiveProject pointer“);
return S_FALSE;
}
CComQIPtr m_ActiveProject(m_pDispatch);
CComBSTR type;
hr=m_ActiveProject->get_Type(&type);
if(FAILED(hr))
{
AfxMessageBox(“Unable to obtain the ActiveProject type“);
return S_FALSE;
}
CString s_type(type);
CComQIPtr m_BuildProject;
m_BuildProject=m_ActiveProject;
CComVariant reserved=NULL;
while(position != NULL)
{
file_name=AddFiles.GetNextPathName(position);
if(s_type == “Build“)
{
hr=m_BuildProject->AddFile(CComBSTR(file_name) reserved);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4602 1999-05-27 12:37 FileTool\Commands.cpp
文件 1022 1999-01-05 15:26 FileTool\Commands.h
文件 90259 2011-08-24 13:47 FileTool\Debug\Commands.obj
文件 33130 2011-08-24 13:47 FileTool\Debug\Commands.sbr
文件 77020 2011-08-24 13:47 FileTool\Debug\DSAddIn.obj
文件 23001 2011-08-24 13:47 FileTool\Debug\DSAddIn.sbr
文件 134576 2011-08-24 13:47 FileTool\Debug\FileTool.dll
文件 1018 2011-08-24 13:47 FileTool\Debug\FileTool.exp
文件 1768 2011-08-24 13:47 FileTool\Debug\FileTool.lib
文件 71235 2011-08-24 13:47 FileTool\Debug\FileTool.map
文件 143326 2011-08-24 13:47 FileTool\Debug\FileTool.obj
文件 8688692 2011-08-24 13:47 FileTool\Debug\FileTool.pch
文件 877568 2011-08-24 13:47 FileTool\Debug\FileTool.pdb
文件 4580 2011-08-24 13:47 FileTool\Debug\FileTool.res
文件 27016 2011-08-24 13:47 FileTool\Debug\FileTool.sbr
文件 1724 2011-08-24 13:47 FileTool\Debug\FileTool.tlb
文件 117957 2011-08-24 13:47 FileTool\Debug\StdAfx.obj
文件 1534636 2011-08-24 13:47 FileTool\Debug\StdAfx.sbr
文件 246784 2011-08-24 13:47 FileTool\Debug\vc60.idb
文件 462848 2011-08-24 13:47 FileTool\Debug\vc60.pdb
文件 4296 1999-01-05 15:54 FileTool\DSAddIn.cpp
文件 1333 1999-01-05 15:23 FileTool\DSAddIn.h
文件 4506 1999-01-05 15:17 FileTool\FileTool.cpp
文件 302 1999-01-05 15:17 FileTool\FileTool.def
文件 4752 1999-09-10 12:44 FileTool\FileTool.dsp
文件 539 1999-01-05 15:17 FileTool\FileTool.dsw
文件 724 1999-01-05 15:17 FileTool\FileTool.h
文件 82944 2012-01-12 10:43 FileTool\FileTool.ncb
文件 1138 1999-01-05 15:21 FileTool\FileTool.odl
文件 53760 2012-01-12 10:43 FileTool\FileTool.opt
............此处省略28个文件信息
- 上一篇:CodeVisionAVR使用简介
- 下一篇:tcp客户端程序之mfc实现
相关资源
- 移木块游戏,可以自编自玩,vc6.0编写
- MFC数字钟(基于VC6.0)
- 安科瑞智能电能表MODBUS通讯程序 VC6
- VC6LineNumberAddin.dll
- 用VC6.0实现多边形扫描线填充算法
- VC助手 VC6.0助手
- VC6 USB开发源码
- 吕鑫vc6c++数据结构视频源码
- MFC的异步网络通讯应用程序
- VC6查找与替换插件
- UC/OS2 (UCOS2)移植于VC6代码及手册
- VC6.0 完整的图像处理程序 运用了大量
- VC6.0经典串口通信源程序C++
- VC6.0MFC界面美化
- 即时通讯开发源码终极版C#.NETC++都有
- win7风格的mfc界面美化源代码
- VS打开VC6.0所需libcd.lib
- MFC画圆自定义|位置|半径|边界和内部
- 用vc++6.0实现的银行账户管理系统
- vc6.0编程助手Visual_AssistX(含破解补丁
- Hoo WinTail 最新版本(v4.2.982)破解补丁
- VC6.0_MFC画图demo小程序源码
- Visual_assist_X_for_VC6.0破解版.rar
- Eclipse C/C++ 自动补全的cdt补丁
- C++&easyx;的坦克大战
- VC开发MFC局域网屏幕监控系统完美版
- VC6.0三维画图画三维球,立方体,矩形
- VC6中使用MFC自动化Excel数据写入和图表
- MFC 下写的SVM类
- VC6.0获取MAC地址
评论
共有 条评论