工程的配置
1、把include_cpp复制到工程文件夹下,设置包含目录
2、把libxl.lib复制到工程文件夹下,附加依赖项:libxl.lib
3、把libxl.dll复制到Debug下
Dlg.cpp下补充头文件与命名空间
#include “libxl.h”
#include
using namespace libxl;
Dlg.cpp下主要代码:
const TCHAR* ReadDataToWChar(Sheet* sheet, int row,int col)
{
CellType type = sheet->cellType(row,col);
TCHAR buff[1024];
switch (type)
{
case 1://Num
{
swprintf_s(buff,1024,_T("%.2lf"),sheet->readNum(row,col));
return buff;
}
case 2://Str
{
return sheet->readStr(row,col);
}
default:
{
return _T(“读取错误!”);
}
}
}