资源简介
通过示例源码你可以更加灵活的控制Excel表格文件,其中包括创建新Excel文件、写入表格数据、读取表格数据(包括对原建Excel文件自已手工添加的行、列数据的准确读取),删除已有Excel表格,对表格中指定行、列、单元格进行查询、插入、替换等操作,同时还可以将生成的Excel文件转换为按指定分隔符分隔的其它文本格式的文件。

代码片段和文件信息
#include “stdafx.h“
#include “CeXDib.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
CCeXDib::CCeXDib()
{
m_hDib = NULL;
m_dwLineWidth = 0;
m_wColors = 0;
m_hMemDC = NULL;
m_hBitmap = NULL;
m_lpBits = NULL;
FreeResources();
}
CCeXDib::~CCeXDib()
{
FreeResources();
}
void CCeXDib::FreeResources()
{
if (m_hMemDC) ::DeleteDC(m_hMemDC);
if (m_hBitmap) ::Deleteobject(m_hBitmap);
if (m_hDib) delete m_hDib;
m_hDib = NULL;
m_hMemDC = NULL;
m_hBitmap = NULL;
m_lpBits = NULL;
memset(&m_bi 0 sizeof(m_bi));
} // End of FreeResources
HDIB CCeXDib::Create(DWORD dwWidth DWORD dwHeight WORD wBitCount)
{
LPBITMAPINFOHEADER lpbi = NULL; // Pointer to BITMAPINFOHEADER
DWORD dwLen = 0; // Size of memory block
FreeResources();
// Following is taken from
// CDIBSectionLite class by Chris Maunder
switch (wBitCount)
{
case 1: m_wColors = 2; break;
#ifdef _WIN32_WCE
case 2: m_wColors = 4; break; // winCE only
#endif
case 4: m_wColors = 16; break;
case 8: m_wColors = 256; break;
case 16:
case 24:
case 32: m_wColors = 0; break; // 1624 or 32 bpp have no color table
default:
m_wColors = 0;
} // switch
/*
// Make sure bits per pixel is valid
if (wBitCount <= 1) wBitCount = 1;
else if (wBitCount <= 4) wBitCount = 4;
else if (wBitCount <= 8) wBitCount = 8;
else wBitCount = 24;
switch (wBitCount)
{
case 1:
m_wColors = 2;
break;
case 4:
m_wColors = 16;
break;
case 8:
m_wColors = 256;
break;
default:
m_wColors = 0;
break;
} // switch
*/
m_dwLineWidth = WIDTHBYTES(wBitCount * dwWidth);
// Initialize BITMAPINFOHEADER
m_bi.biSize = sizeof(BITMAPINFOHEADER);
m_bi.biWidth = dwWidth; // fill in width from parameter
m_bi.biHeight = dwHeight; // fill in height from parameter
m_bi.biPlanes = 1; // must be 1
m_bi.biBitCount = wBitCount; // from parameter
m_bi.biCompression = BI_RGB;
m_bi.biSizeImage = m_dwLineWidth * dwHeight;
m_bi.biXPelsPerMeter = 0;
m_bi.biYPelsPerMeter = 0;
m_bi.biClrUsed = 0;
m_bi.biClrImportant = 0;
// Calculate size of memory block required to store the DIB. This
// block should be big enough to hold the BITMAPINFOHEADER the color
// table and the bits.
dwLen = GetSize();
m_hDib = new HDIB[dwLen]; // Allocate memory block to store our bitmap
if (m_hDib == NULL) return NULL;
// Use our bitmap info structure to fill in first part of
// our DIB with the BITMAPINFOHEADER
lpbi = (LPBITMAPINFOHEADER)(m_hDib);
*lpbi = m_bi;
return m_hDib; // Return handle to the DIB
} // End o
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8684 2001-12-03 17:54 ExcelAccessSrc\CeXDib.cpp
文件 2328 2001-12-04 11:23 ExcelAccessSrc\CeXDib.h
文件 34182 1997-01-01 03:42 ExcelAccessSrc\CSpreadSheet.h
文件 1649 2003-05-01 00:28 ExcelAccessSrc\ExcelAccess.clw
文件 2855 2003-05-01 04:02 ExcelAccessSrc\ExcelAccess.cpp
文件 4957 2003-05-01 00:46 ExcelAccessSrc\ExcelAccess.dsp
文件 545 1997-01-01 00:39 ExcelAccessSrc\ExcelAccess.dsw
文件 90112 2003-05-01 00:53 ExcelAccessSrc\ExcelAccess.exe
文件 1604 2003-05-01 03:55 ExcelAccessSrc\ExcelAccess.h
文件 1543 2003-05-01 00:53 ExcelAccessSrc\ExcelAccess.plg
文件 6410 2003-05-01 00:44 ExcelAccessSrc\ExcelAccess.rc
文件 14281 2003-05-01 00:53 ExcelAccessSrc\ExcelAccessDlg.cpp
文件 2403 2003-05-01 00:30 ExcelAccessSrc\ExcelAccessDlg.h
文件 1069 2003-01-04 18:47 ExcelAccessSrc\HoverEdit.cpp
文件 1269 2003-01-04 18:46 ExcelAccessSrc\HoverEdit.h
文件 100590 2003-04-13 13:22 ExcelAccessSrc\PPTooltip.cpp
文件 16510 2003-04-13 10:54 ExcelAccessSrc\PPTooltip.h
目录 0 2003-05-27 19:59 ExcelAccessSrc\res\
文件 1078 2003-05-01 04:23 ExcelAccessSrc\res\ExcelAccess.ico
文件 403 1997-01-01 00:39 ExcelAccessSrc\res\ExcelAccess.rc2
文件 14333 2002-09-27 00:06 ExcelAccessSrc\res\Flag.gif
文件 2238 2003-05-01 00:43 ExcelAccessSrc\res\Info.ico
文件 1001 2003-05-01 00:44 ExcelAccessSrc\resource.h
文件 213 1997-01-01 00:39 ExcelAccessSrc\StdAfx.cpp
文件 1134 2003-05-01 00:41 ExcelAccessSrc\StdAfx.h
文件 1799 2003-01-04 18:47 ExcelAccessSrc\TrackControl.h
文件 6320 2002-12-25 10:38 ExcelAccessSrc\XPButton.cpp
文件 1885 2002-12-25 10:38 ExcelAccessSrc\XPButton.h
目录 0 2003-05-27 19:59 ExcelAccessSrc\
文件 3575 2003-05-26 16:21 ShadowButton.zip
- 上一篇:经典差分进化算法的C++语言实现
- 下一篇:vc++6.0开发的音频采集程序
相关资源
- VC++ 多线程文件读写操作
- 移木块游戏,可以自编自玩,vc6.0编写
- VC++MFC小游戏实例教程(实例)+MFC类库
- VC++实现CMD命令执行与获得返回信息
- VC++基于OpenGL模拟的一个3维空间模型
- 使用Qt实现Excel读取工具
- 基于VC++的SolidWorks二次开发SolidWorks
- 派克变换VC++源码(附文档)
- VC++ 串口
- VC++ 大富翁4_大富翁游戏源码
- VC++ 摄像头视频采集与回放源程序
- 转 VC++ 实现电子邮件(Email)发送
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- VC++ 服务程序编写及安装与卸载
- VC++6.0番茄西红柿VAXvirsual assist X完美破
- 基于改进的fcm算法的图像分割vc++
- VC++6.0 绿色版,免安装,非常好用。
- Microsoft Visual C++ 2005 Redistributable Pack
- VC++MFC课程设计的学生成绩管理系统
- 大智慧365DLL插件设计
- VC++6.0汉化包
- VC++完整商业界面源码(再上传)
- VC++编程技术600个大型项目源码.rar
- VC++实现RSA加密算法
- C++ 读取excel2007文件,转成lua文件
- VC++ 中国象棋经典游戏源代码
- 郁金香VC++游戏辅助视频教程
- C语言进阶源码---基于graphics实现图书
- 摄影测量相对定向VC++程序
- VC++数字图像处理典型算法及实现
评论
共有 条评论