📄 doctest.cpp
字号:
// DocTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "DocTest.h"
#include "DocDecoder.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
CODEC* FindCodec(int cp)
{
return NULL;
}
CODEC* FindCodecName(const char *name)
{
return NULL;
}
// The one and only application object
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
CDocDecoder doc(NULL);
char *infile="D:\\常规数据链.doc";
char *outfile="D:\\test.txt";
unsigned char* outbuf=new unsigned char [2*1024*1024];
unsigned char* inbuf=new unsigned char[2*1024*1024];
int inbuflen=2*1024*1024;
int outbuflen,type;
FILE *in;
in=fopen(infile,"rb");
inbuflen=fread(inbuf,1,inbuflen,in);
fclose(in);
doc.decode(inbuf,inbuflen,outbuf,0);
outbuf=doc.get_result(outbuflen,type);
FILE *f;
f=fopen(outfile,"wb");
fwrite(outbuf,1,outbuflen,f);
fclose(f);
delete outbuf;
delete inbuf;
}
return nRetCode;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -