資源簡介
epson 熱敏打印機 打印 源碼 vc6 熱敏串口打印

代碼片段和文件信息
#include?“stdafx.h“
#include?
#include?“PubFunc.h“
extern?short?g_nLogLevel;
void?CFunc::CutString(const?CString?&strRes?CString?&strOut?long?lLen)
{
CString?strTmp?=?““;
unsigned?char?ch?=?0;
int?iFlag?=?0?i?=?0;
if?(strRes.IsEmpty())
{
strOut?=?““;
return;
}
if?(lLen?>=?strRes.GetLength())?
{
strOut?=?strRes;
return;
}
lLen?=?lLen?-?2;
i?=?0;?
iFlag?=?0;
while?(i?+?1?(lLen))
{
ch?=?static_cast(strRes.GetAt(i));
if?(ch?>?127?||?ch?30)
{
strTmp?+=?strRes.Mid(i?2);
i++;
}
else
{
strTmp?+=?strRes.Mid(i?1);
}
i++;
}
strOut?=?strTmp?+?“..“;
return;
}
long?CFunc::GetFldStr(const?CString?&strIn?const?CString?&strFilter?int?iNo?CString?&strOut)
{
int?i?=?0?cnt?=?0;
unsigned?char?ch?=?0;
while?((ch?=?strIn.GetAt(i))?!=?NULL)
{
if?(ch?==?strFilter.GetAt(0))
{
cnt++;
if?(cnt?==?iNo)
{
break;
}
else
{
strOut.Empty();
}
}
else
{
strOut?+=?CString(ch);
}
i?+=?1;
}
return?cnt;
}
long?CFunc::GetFldStr(CString?&strIn?const?CString?&strFilter?CString?&strOut)
{
int?i?=?0?cnt?=?0;
unsigned?char?ch?=?0;
if?(strIn.IsEmpty())
{
return?0;
}
while?((ch?=?strIn.GetAt(i++))?!=?NULL)
{
if?(ch?==?strFilter.GetAt(0))
{
strIn?=?strIn.Mid(cnt?+?1);
break;
}
else
{
strOut?+=?CString(ch);
}
cnt++;
}
return?cnt;
}
long?CFunc::GetFldStr(char*?pszInbuf?const?char*?pszFilter?int?iNo?char*?pszOutBuf)
{
long?i?=?0?j?=?0?m?=?0?n?=?0;
while?(*(pszInbuf?+?i))
{
if?(*(pszInbuf?+?i)?==?*pszFilter)
{
m++;
if?(m?==?iNo)
{
*(pszOutBuf?+?j)?=?0x0;
break;
}
else?
{
memset(pszOutBuf?0?j);
j?=?0;
}
}
else
{
*(pszOutBuf?+?j++)?=?*(pszInbuf?+?i);
}
i++;
}
return?0;
}
BOOL?CFunc::IsDirExist(const?CString?&strPath)
{
BOOL?bRet?=?FALSE;
char?szCurrentDiretory[512]?=?{‘\0‘};
GetCurrentDirectory(512?szCurrentDiretory);
bRet?=?SetCurrentDirectory(strPath);
SetCurrentDirectory(szCurrentDiretory);
return?bRet;
}
void?CFunc::MakeDir(const?CString?&strDir)
{
BOOL?bRet?=?FALSE;
bRet?=?IsDirExist(strDir);
if?(!bRet)
{
::CreateDirectory(strDir?NULL);
}
return;
}
long?CFunc::GetSubFolderTotal(CString?strPath)
{
CFileFind?OneFile;
BOOL?bWorking?=?FALSE;
long?total?=?0;
if?(strPath.Right(1)?!=?“\\“)
{
strPath?+=?“\\*.*“;
}
bWorking?=?OneFile.FindFile(strPath);
while?(bWorking)
{
bWorking?=?OneFile.FindNextFile();
if?(OneFile.IsDirectory()?&&?!OneFile.IsDots())
{
total++;
}
}
OneFile.Close();
return?total;
}
long?CFunc::GetDate(const?CString?&strFmt?CString?&strDate)
{
CTime?vTime?=?CTime::GetCurrentTime();
if?(strFmt?==?“YYYY-MM-DD“)
{
strDate.Format(“%04ld-%02ld-%02ld“?vTime.GetYear()?vTime.GetMonth()?vTime.
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????61166??2011-07-11?16:00??ReceiptPrint\Debug\PubFunc.obj
?????文件?????127070??2011-07-11?16:00??ReceiptPrint\Debug\ReceiptPrint.dll
?????文件???????1699??2011-07-11?16:13??ReceiptPrint\Debug\ReceiptPrint.exp
?????文件?????221432??2011-07-11?16:00??ReceiptPrint\Debug\ReceiptPrint.ilk
?????文件???????3724??2011-07-11?16:13??ReceiptPrint\Debug\ReceiptPrint.lib
?????文件??????37928??2011-07-11?16:21??ReceiptPrint\Debug\ReceiptPrint.obj
?????文件????6604960??2011-07-11?16:00??ReceiptPrint\Debug\ReceiptPrint.pch
?????文件?????386048??2011-07-11?16:21??ReceiptPrint\Debug\ReceiptPrint.pdb
?????文件????????848??2011-07-11?16:00??ReceiptPrint\Debug\ReceiptPrint.res
?????文件?????118013??2011-07-11?16:00??ReceiptPrint\Debug\StdAfx.obj
?????文件?????246784??2011-07-11?16:23??ReceiptPrint\Debug\vc60.idb
?????文件?????430080??2011-07-11?16:21??ReceiptPrint\Debug\vc60.pdb
?????文件??????57856??1998-10-19?13:41??ReceiptPrint\Pcomm.dll
?????文件???????7223??2003-12-30?15:23??ReceiptPrint\Pcomm.h
?????文件??????35218??1999-04-27?20:41??ReceiptPrint\Pcomm.lib
?????文件??????13495??2010-12-26?08:28??ReceiptPrint\PubFunc.cpp
?????文件???????1428??2010-12-26?08:00??ReceiptPrint\PubFunc.h
?????文件???????2642??2010-12-22?11:26??ReceiptPrint\ReadMe.txt
?????文件??????18092??2011-07-08?13:15??ReceiptPrint\ReceiptPrint.aps
?????文件????????358??2010-12-22?11:26??ReceiptPrint\ReceiptPrint.clw
?????文件??????16437??2012-01-06?15:07??ReceiptPrint\ReceiptPrint.cpp
?????文件????????324??2010-12-25?23:52??ReceiptPrint\ReceiptPrint.def
?????文件???????4609??2011-07-11?16:18??ReceiptPrint\ReceiptPrint.dsp
?????文件????????549??2010-12-22?11:26??ReceiptPrint\ReceiptPrint.dsw
?????文件???????1319??2010-12-22?11:26??ReceiptPrint\ReceiptPrint.h
?????文件??????99328??2012-01-06?15:07??ReceiptPrint\ReceiptPrint.ncb
?????文件????1262592??2012-01-06?15:07??ReceiptPrint\ReceiptPrint.opt
?????文件????????260??2012-01-06?02:25??ReceiptPrint\ReceiptPrint.plg
?????文件???????3101??2010-12-22?11:26??ReceiptPrint\ReceiptPrint.rc
?????文件??????32205??2011-05-24?09:06??ReceiptPrint\Release\PubFunc.obj
............此處省略19個文件信息
- 上一篇:簡單函數繪圖語言的解釋器
- 下一篇:C++程序設計:第2版---吳乃陵
評論
共有 條評論