Files
envi-code/SourceCode/Code2026/tg_shs/shs_blklib/bloption.cpp
T
2026-09-28 15:28:50 +08:00

52 lines
1.3 KiB
C++

#include "stdafx.h"
#include "bloption.h"
/************************** Input Item Info **************/
const TCHAR * DwbStruct::szTileKeys[]={_T("kind"),_T("item"), _T("drawing"),};
int DwbStruct:: nTileNum=ELEMENTS(szTileKeys);
int DwbStruct::SortByItem(const DwbStruct *p1, const DwbStruct *p2)
{
DwbStruct *pp1 = (DwbStruct *)p1,
*pp2 = (DwbStruct *)p2;
return _tcscmp(pp1->sItem, pp2->sItem);
}
DwbStruct::DwbStruct(XDbfTable *table)
{
CString sTmp;
GET_FIELD(table, _T("kind"), sTmp);
sKind = sTmp;
GET_FIELD(table, _T("item"), sTmp);
sItem = sTmp;
GET_FIELD(table, _T("drawing"), sTmp);
sDrawing = sTmp;
}
void DwbStruct::UpdateTable(XDbfTable *table)
{
SET_FIELD(table, _T("kind"), sKind);
SET_FIELD(table, _T("item"), sItem);
SET_FIELD(table, _T("drawing"), sDrawing);
}
BOOL CreateTKFile(const TCHAR *pszFile)
{
/* {
FieldInfo fields[4];
fields[0] = FieldInfo(_T("kind"), _T('C'), 200);
fields[1] = FieldInfo(_T("item"), _T('C'), 64);
fields[2] = FieldInfo(_T("drawing"), _T('C'), 32);
CodeBase db;
sTempName=GetTempFileName(_T("tk"));
XDbfTable *pTable = db.Create(sTempName, fields);
bRet=(pTable!=NULL);
}*/
//modified by cwk on 060912
XString sTempName;
if(FindFile(_T("newtk.tk"),sTempName))
return CopyFile(sTempName,pszFile,FALSE);
else
return FALSE;
}