?? reader.h
字號:
// Reader.h: interface for the CReader class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_READER_H__391CFB5C_FA60_4BC5_B044_CC7BB81FFD78__INCLUDED_)
#define AFX_READER_H__391CFB5C_FA60_4BC5_B044_CC7BB81FFD78__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <vector>
#include "DBF.h"
class TNotifyMsg
{
public:
TNotifyMsg(CString tsState,float tfProgress){
m_sState = tsState;
m_fProgress = tfProgress;
};
const CString GetState(){
return m_sState;
};
const float GetProgress(){
return m_fProgress;
};
virtual ~ TNotifyMsg(){;};
private:
CString m_sState;
float m_fProgress;
};
class CReader
{
public:
CReader(CWnd * tpNotifyWnd,CString tsFileSource,CString tsFileSaved);
virtual ~CReader();
void DoWork();
public:
static const int WM_WTNOTIFY;
protected:
class CWorkThread : public CWinThread
{
public:
CWorkThread(){
m_fProgress = 0.0f;
mDbf = new CDBF();
};
virtual ~ CWorkThread(){
DestroyDatas();
};
void SetNotifyWnd(CWnd * tpWnd){
m_pWndNotify = tpWnd;
};
void SetSourceFilePath(CString tsFilePath){
m_sSourceFile = tsFilePath;
};
void SetSavedtFilePath(CString tsFilePath){
m_sSavedFile = tsFilePath;
};
static SortByFirst(CRecord * tpA,CRecord * tpB){
int iValue1,iValue2;
unsigned int iLen1,ilen2;
unsigned char buf1[MAXCHAR];
unsigned char buf2[MAXCHAR];
ZeroMemory(buf1,sizeof(buf1));
ZeroMemory(buf2,sizeof(buf2));
tpA->GetFirstField(buf1,&iLen1);
tpB->GetFirstField(buf2,&ilen2);
buf1[iLen1 + 1] = 0;
buf2[ilen2 + 1] = 0;
if (strcmp((char*)buf1,(char*)buf2) <= 0)
{
return TRUE;
}
else
{
return FALSE;
}
};
protected:
virtual BOOL InitInstance();
virtual int Run();
BOOL DoSourceFile();
BOOL DoSavedFile();
void SendNotifyMsg();
void SetState(CString tsState){
m_sStateString = tsState;
};
void SetProgress(float tfProgress){
m_fProgress = tfProgress;
};
void DestroyDatas();
private:
CWnd * m_pWndNotify;
CString m_sStateString;
float m_fProgress;
CString m_sSourceFile;
CString m_sSavedFile;
CDBF *mDbf;
std::vector<CRecord * > m_vctRecord;
} m_ctworker;
};
#endif // !defined(AFX_READER_H__391CFB5C_FA60_4BC5_B044_CC7BB81FFD78__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -