⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpptestview.cpp

📁 具有数据压缩和解压缩功能的地动态库。 采用Delphi内置的压缩库实现。压缩效率略低于zip。
💻 CPP
字号:
// CPPTestView.cpp : implementation of the CCPPTestView class
//

#include "stdafx.h"
#include "CPPTest.h"

#include "CPPTestDoc.h"
#include "CPPTestView.h"

#include "Compress.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCPPTestView

IMPLEMENT_DYNCREATE(CCPPTestView, CView)

BEGIN_MESSAGE_MAP(CCPPTestView, CView)
	//{{AFX_MSG_MAP(CCPPTestView)
	ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCPPTestView construction/destruction

CCPPTestView::CCPPTestView()
{
}

CCPPTestView::~CCPPTestView()
{
}

BOOL CCPPTestView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CCPPTestView drawing

void CCPPTestView::OnDraw(CDC* pDC)
{
	CCPPTestDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CCPPTestView printing

BOOL CCPPTestView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CCPPTestView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CCPPTestView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CCPPTestView diagnostics

#ifdef _DEBUG
void CCPPTestView::AssertValid() const
{
	CView::AssertValid();
}

void CCPPTestView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CCPPTestDoc* CCPPTestView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCPPTestDoc)));
	return (CCPPTestDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CCPPTestView message handlers

void CCPPTestView::OnEditCopy() 
{
	// TODO: Add your command handler code here
	char Buf[1000] = "3111sssssssssssssssssssssssssggggggggghghgWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWhghghghghghghghghghghg1111111111111111111111111112";
	char OBuf[1000];
	int Len, Len2;
	char IBuf[1000];

	CompressBuffer(Buf, strlen(Buf), OBuf, &Len);
	DecompressBuffer(OBuf, Len, IBuf, &Len2);
	IBuf[Len2] = 0;
	AfxMessageBox(IBuf);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -