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

📄 testlistctrltoexcelview.cpp

📁 以SQL语句从数据库里查询出记录
💻 CPP
字号:
// TestListCtrlToExcelView.cpp : implementation of the CTestListCtrlToExcelView class
//

#include "stdafx.h"
#include "TestListCtrlToExcel.h"

#include "TestListCtrlToExcelDoc.h"
#include "TestListCtrlToExcelView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CTestListCtrlToExcelView

IMPLEMENT_DYNCREATE(CTestListCtrlToExcelView, CFormView)

BEGIN_MESSAGE_MAP(CTestListCtrlToExcelView, CFormView)
	//{{AFX_MSG_MAP(CTestListCtrlToExcelView)
	ON_WM_SIZE()
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTestListCtrlToExcelView construction/destruction

CTestListCtrlToExcelView::CTestListCtrlToExcelView()
	: CFormView(CTestListCtrlToExcelView::IDD)
{
	//{{AFX_DATA_INIT(CTestListCtrlToExcelView)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	// TODO: add construction code here

}

CTestListCtrlToExcelView::~CTestListCtrlToExcelView()
{
}

void CTestListCtrlToExcelView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTestListCtrlToExcelView)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}

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

	return CFormView::PreCreateWindow(cs);
}

void CTestListCtrlToExcelView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit(FALSE);
}

/////////////////////////////////////////////////////////////////////////////
// CTestListCtrlToExcelView printing

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

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

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

void CTestListCtrlToExcelView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
	// TODO: add customized printing code here
}

/////////////////////////////////////////////////////////////////////////////
// CTestListCtrlToExcelView diagnostics

#ifdef _DEBUG
void CTestListCtrlToExcelView::AssertValid() const
{
	CFormView::AssertValid();
}

void CTestListCtrlToExcelView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CTestListCtrlToExcelView message handlers

void CTestListCtrlToExcelView::OnSize(UINT nType, int cx, int cy) 
{
	CFormView::OnSize(nType, cx, cy);
	
	// TODO: Add your message handler code here
	if(cx*cy<0.01)return;
	if(cx<0.||cy<0.)return;
	if(m_wndDlg.m_hWnd)m_wndDlg.MoveWindow(0,0,cx,cy);
	
}

int CTestListCtrlToExcelView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CFormView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	m_wndDlg.Create(IDD_DIALOG1,this);
	m_wndDlg.ShowWindow(SW_SHOW);
	
	return 0;
}

⌨️ 快捷键说明

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