资源简介
CGridListCtrlEx 组合ListCtrl应用示例
代码片段和文件信息
#include “stdafx.h“
#include “CSpreadSheet.h“
// Open spreadsheet for reading and writing
CSpreadSheet::CSpreadSheet(CString File CString SheetOrSeparator bool Backup) :
m_Database(NULL) m_rSheet(NULL) m_sFile(File)
m_dTotalRows(0) m_dTotalColumns(0) m_dCurrentRow(1)
m_bAppend(false) m_bBackup(Backup) m_bTransaction(false)
{
// Detect whether file is an Excel spreadsheet or a text delimited file
m_stempString = m_sFile.Right(4);
m_stempString.MakeLower();
if (m_stempString == L“.xls“) // File is an Excel spreadsheet
{
m_bExcel = true;
//ignored by yugz 09-08-01 11:05 Saturday
//if ( !SheetOrSeparator.IsEmpty() )
//{
m_sSheetName = SheetOrSeparator;
//}
//else
//{
// m_sSheetName = L““;
//}
m_sSeparator = L“;.?“;
}
else // File is a text delimited file
{
m_bExcel = false;
if (SheetOrSeparator)
{
m_sSeparator = SheetOrSeparator;
}
else
{
m_sSeparator=L““;
}
}
if (m_bExcel) // If file is an Excel spreadsheet
{
m_Database = new CDatabase;
GetExcelDriver();
m_sDsn.Format(L“DRIVER={%s};DSN=‘‘; FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\“%s\“;DBQ=%s“ m_sExcelDriver m_sFile m_sFile);
if (Open())
{
if (m_bBackup)
{
if ((m_bBackup) && (m_bAppend))
{
CString tempSheetName = m_sSheetName;
m_sSheetName = L“CSpreadSheetBackup“;
m_bAppend = false;
if (!Commit())
{
m_bBackup = false;
}
m_bAppend = true;
m_sSheetName = tempSheetName;
m_dCurrentRow = 1;
}
}
}
}
else // if file is a text delimited file
{
if (Open())
{
if ((m_bBackup) && (m_bAppend))
{
m_stempString = m_sFile;
m_stempSql.Format(_T(“%s.bak“) m_sFile);
m_sFile = m_stempSql;
if (!Commit())
{
m_bBackup = false;
}
m_sFile = m_stempString;
}
}
}
}
// Perform some cleanup functions
CSpreadSheet::~CSpreadSheet()
{
if (m_Database != NULL)
{
m_Database->Close();
delete m_Database;
}
}
// Add header row to spreadsheet
bool CSpreadSheet::AddHeaders(CStringArray &FieldNames bool replace)
{
if (m_bAppend) // Append to old Sheet
{
if (replace) // Replacing header row rather than adding new columns
{
if (!AddRow(FieldNames 1 true))
{
return false;
}
else
{
return TRUE;
}
}
if (ReadRow(m_atempArray 1)) // Add new columns
{
if (m_bExcel)
{
// Check for duplicate header row field
for (int i = 0; i < FieldNames.GetSize(); i++)
{
for (int j = 0; j < m_atempArray.GetSize(); j++)
{
if (FieldNames.GetAt(i) == m_atempArray.GetAt(j))
{
m_sLastError.Format(L“Duplicate header row field:%s\n“ FieldNames.GetAt(i));
return false;
}
}
}
}
m_atempArray.Append(FieldNames);
if (!AddRow(m_atempArray 1 true))
{
m_sLastError = L“Problems with adding headers\n
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 913 2010-01-10 13:09 ola-new\OnLineAnalyse.sln
..A..H. 144384 2010-01-12 18:44 ola-new\OnLineAnalyse.suo
文件 3508 2010-01-10 22:32 ola-new\OnlineLogAnalyse\Book1.csv
文件 20480 2010-01-08 15:31 ola-new\OnlineLogAnalyse\Book1.xls
文件 2679 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTrait.h
文件 9691 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTraitCombo.cpp
文件 2773 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTraitCombo.h
文件 4644 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTraitDateTime.cpp
文件 1812 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTraitDateTime.h
文件 3672 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTraitEdit.cpp
文件 1351 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTraitEdit.h
文件 4150 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTraitText.cpp
文件 1036 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTraitText.h
文件 827 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridColumnTraitVisitor.h
文件 51992 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridListCtrlEx.cpp
文件 7329 2010-01-11 21:14 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridListCtrlEx.h
文件 22874 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridListCtrlGroups.cpp
文件 2549 2010-01-11 21:18 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridListCtrlGroups.h
文件 920 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridRowTrait.h
文件 5331 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridRowTraitText.cpp
文件 1092 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridRowTraitText.h
文件 652 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridRowTraitVisitor.h
文件 4009 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridRowTraitXP.cpp
文件 667 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CGridListCtrlEx\CGridRowTraitXP.h
目录 0 2010-01-12 09:52 ola-new\OnlineLogAnalyse\CGridListCtrlEx
文件 32069 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CSpreadSheet.cpp
文件 5490 2009-12-07 14:32 ola-new\OnlineLogAnalyse\CSpreadSheet.h
文件 18738 2010-01-11 16:24 ola-new\OnlineLogAnalyse\f.csv
文件 14848 2010-01-11 13:11 ola-new\OnlineLogAnalyse\f.xls
文件 420 2010-01-11 14:01 ola-new\OnlineLogAnalyse\filter.csv
............此处省略35个文件信息
- 上一篇:shp文件转换为带属性的dwg文件
- 下一篇:mockplus新闻原型
相关资源
- 2-d and 3-d Image Registration: for Medical Re
- Updater Application Block组件及详细文档
- turtlebot上hokuyo和gmapping建图和amcl导航
- Generalized Inverses Theory and application
- 简约自适应APP页源码
- STM32F103微控制器在线升级IAP功能,文
- 安卓APP微信分享.zip
- Linear Algebra and Its Applications习题解答
- State Estimation for Robotics-A Matrix Lie Gro
- State Estimation for Robotics A Matrix Lie Gro
- mui开发的app,非常好资源,适合初学
- Convex Optimization and Its Applications in Si
- 高仿番茄时钟APP demo
- 关于新闻的APP代码,有兴趣的可以参
- 《ComputerNetworksATop-DownApproach》(Foro
- 猫眼项目app
- notepadd++
- app操作手册范本
- Delta-Sigma Modulators - Modeling Design and A
- Applied Bayesian Statistics---With R and OpenB
- Lidar Odometry and mapping in real time
- 安卓记事本
- 完整版原创STM32F103串口IAP升级程序小
- The Special Functions and Their Approximations,
- JULIUSO. SMITHIII《INTRODUCTION TO DIGITAL FI
- 《深入理解计算机系统》随书代码
- Discrete Mathematics with Applications 4th edi
- musicApp.rar
- notepad++32位
- MyBatis Generator自定义插件实现自定义
评论
共有 条评论