亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ado1view.cpp

?? Visual C++ From the Ground Up Second Edition 例程源代碼
?? CPP
字號:
// ADO1View.cpp : implementation of the CADO1View class
//

#include "stdafx.h"
#include "ADO1.h"

#include "ADO1Set.h"
#include "ADO1Doc.h"
#include "ADO1View.h"

// Include the C_Recordset class so that we
// can manipulate the recordset directly.
#include "_Recordset.h"

// Include the CColumn class so that we can
// modify the DataGrid1 display format.
#include "Column.h"
#include "Columns.h"

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

/////////////////////////////////////////////////////////////////////////////
// CADO1View

IMPLEMENT_DYNCREATE(CADO1View, COleDBRecordView)

BEGIN_MESSAGE_MAP(CADO1View, COleDBRecordView)
	//{{AFX_MSG_MAP(CADO1View)
	ON_WM_SIZE()
	ON_COMMAND(ID_RECORD_FIRST2, OnRecordFirst2)
	ON_COMMAND(ID_RECORD_LAST2, OnRecordLast2)
	ON_COMMAND(ID_RECORD_NEXT2, OnRecordNext2)
	ON_COMMAND(ID_RECORD_PREV2, OnRecordPrev2)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, COleDBRecordView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, COleDBRecordView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, COleDBRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CADO1View construction/destruction

CADO1View::CADO1View()
	: COleDBRecordView(CADO1View::IDD)
{
	//{{AFX_DATA_INIT(CADO1View)
	m_pSet = NULL;
	//}}AFX_DATA_INIT

	// TODO: add construction code here

}

CADO1View::~CADO1View()
{
}

void CADO1View::DoDataExchange(CDataExchange* pDX)
{
	COleDBRecordView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CADO1View)
	DDX_Control(pDX, IDC_ADODC1, m_adoDC1);
	DDX_Control(pDX, IDC_DATAGRID1, m_dataGrid1);
	//}}AFX_DATA_MAP
}

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

	return COleDBRecordView::PreCreateWindow(cs);
}

void CADO1View::OnInitialUpdate()
{
	m_pSet = &GetDocument()->m_aDO1Set;
	{
		CWaitCursor wait;
		HRESULT hr = m_pSet->Open();
		if (hr != S_OK)
		{
			AfxMessageBox(_T("Record set failed to open."), MB_OK);
			// Disable the Next and Previous record commands,
			// since attempting to change the current record without an
			// open RecordSet will cause a crash.
			m_bOnFirstRecord = TRUE;
			m_bOnLastRecord = TRUE;
		}				
	}

	COleDBRecordView::OnInitialUpdate();

}

/////////////////////////////////////////////////////////////////////////////
// CADO1View printing

BOOL CADO1View::OnPreparePrinting(CPrintInfo* pInfo)
{

	// default preparation
	return DoPreparePrinting(pInfo);
}

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

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

/////////////////////////////////////////////////////////////////////////////
// CADO1View diagnostics

#ifdef _DEBUG
void CADO1View::AssertValid() const
{
	COleDBRecordView::AssertValid();
}

void CADO1View::Dump(CDumpContext& dc) const
{
	COleDBRecordView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CADO1View database support
CRowset* CADO1View::OnGetRowset()
{
	return m_pSet;
}


/////////////////////////////////////////////////////////////////////////////
// CADO1View message handlers

void CADO1View::OnSize(UINT nType, int cx, int cy) 
{
	int  iHeight, iWidth;	// Control height and width.
	CRect rect;				// Control size.

	// Perform the default action.
	COleDBRecordView::OnSize(nType, cx, cy);

	// Reposition AdoDC1.
	m_adoDC1.GetClientRect(rect);
	iHeight = rect.Height();
	iWidth = rect.Width();
	m_adoDC1.MoveWindow(cx, cy, iWidth, iHeight, TRUE);

	// Resize and reposition DataGrid1
	m_dataGrid1.MoveWindow(0, 0, cx, cy - iHeight, TRUE);
}

void CADO1View::OnRecordFirst2() 
{
	// Move to the first record.
	m_adoDC1.GetRecordset().MoveFirst();
}

void CADO1View::OnRecordLast2() 
{
	// Move to the last record.
	m_adoDC1.GetRecordset().MoveLast();
}

void CADO1View::OnRecordNext2() 
{
	// Move to the next record.
	m_adoDC1.GetRecordset().MoveNext();
}

void CADO1View::OnRecordPrev2() 
{
	// Check to see if we can move the record pointer.
	if (!m_adoDC1.GetRecordset().GetBof())
	{
		// Move to the previous record.
		m_adoDC1.GetRecordset().MovePrevious();

		// Check again for beginning of file.
		if (m_adoDC1.GetRecordset().GetBof())
		{
			// If we are at the beginning of the file,
			// advance the record pointer to the first record.
			m_adoDC1.GetRecordset().MoveNext();
		}
	}
}


void CADO1View::OnPrint(CDC* pDC, CPrintInfo* pInfo) 
{
    int			iRowCount = 1;				// Current print row count.
    LPSTR		lpstrRow = "EMPTY1";		// Text form of row count.
    CString		cLine;						// One line of printed output.
    CPen		oPen;						// Pen for drawing.
    CBrush		oBrush;						// Brush for shading.
    CFont		oTextFont;					// Font used for displaying text.
    CFont		oHeadFont;					// Font used to display the heading.
    CFont		oColFont;					// Font used to display column headings.
    LOGFONT		lfFont;						// Font characteristic structure.
    CSize		oFontSize;					// Size of a font.
    COLORREF	clrRef;						// Color structure.
    int			iRowPos = 120;				// Row position on printed page.
    int			iTextHeight = 0;			// Current text height.
	CRect		oDrawRect;					// Drawing area for printer.
	int			iRecNumPos;					// Record number position.
	int			iFoodIDPos;					// Food ID position.
	int			iNamePos;					// Name position.
	int			iPerishablePos;				// Perishable position.
	int			iPricePos;					// Price position.
	int			iPurchasePos;				// Purchase Date position.
	int			iQuantityPos;				// Quantity position.
	int			iStoragePos;				// Storage Life position.

	// Get the drawing area for our print routine.
	oDrawRect = pInfo->m_rectDraw;
	
    // Create a pen and select it into our device context.
    clrRef = 0x00000000;
    oPen.CreatePen(PS_SOLID, 2, clrRef);
    pDC->SelectObject(&oPen);

    // Create a brush and select it into our device context.
    clrRef = 0x00C0C0C0;
    oBrush.CreateSolidBrush(clrRef);
    pDC->SelectObject(&oBrush);

    // Create a heading font and select it into our device context.
    oHeadFont.CreatePointFont(240, "Arial", pDC);
    pDC->SelectObject(&oHeadFont);

    // Display our heading.
    oFontSize = pDC->GetOutputTextExtent("The ABC Company");
    pDC->Ellipse(500, 
		iRowPos - (oFontSize.cy / 2) - 10, 
		oDrawRect.Width() - 500, 
		iRowPos + (oFontSize.cy / 2) + 10);
    pDC->SetBkMode(TRANSPARENT);
    pDC->TextOut((oDrawRect.Width() - oFontSize.cx) / 2, 
		iRowPos - (oFontSize.cy / 2) - 10, 
		"The ABC Company");
    pDC->SetBkMode(OPAQUE);

    // Create the appropriate space.
    oHeadFont.GetLogFont(&lfFont);
    iRowPos = abs(lfFont.lfHeight) + 175;

    // Create a text font.
    oTextFont.CreatePointFont(120, "Arial", pDC);

    // Get the current text font height.
    oTextFont.GetLogFont(&lfFont);
    iTextHeight = abs(lfFont.lfHeight) + 10;

    // Create a font for displaying column headings.
    lfFont.lfWeight = 700;    // Make it bold, normal is 400.
    oColFont.CreateFontIndirect(&lfFont);
    pDC->SelectObject(&oColFont);

	// Compute the column spacings.  Set the first column to 1/2 inch.
	iRecNumPos = int(oDrawRect.Width() / 17);
	iFoodIDPos = iRecNumPos + 50 + pDC->GetOutputTextExtent("##").cx;
	iNamePos = iFoodIDPos + 50 + pDC->GetOutputTextExtent("XXX00000XXX").cx;
	iPerishablePos = iNamePos + 50 + pDC->GetOutputTextExtent("Xxxxxxxxxxxxx").cx;
	iPricePos = iPerishablePos + 50 + pDC->GetOutputTextExtent("Perishable").cx;
	iPurchasePos = iPricePos + 50 + pDC->GetOutputTextExtent("$00.00").cx;
	iQuantityPos = iPurchasePos + 50 + pDC->GetOutputTextExtent("Purchase Date").cx;
	iStoragePos = iQuantityPos + 50 + pDC->GetOutputTextExtent("Quantity").cx;

    // Display the column headings.
    pDC->TextOut(iRecNumPos, iRowPos, "#");
    pDC->TextOut(iFoodIDPos, iRowPos, "Food ID");
    pDC->TextOut(iNamePos, iRowPos, "Name");
    pDC->TextOut(iPerishablePos, iRowPos, "Perishable");
    pDC->TextOut(iPricePos, iRowPos, "Price");
    pDC->TextOut(iPurchasePos, iRowPos, "Purchase Date");
    pDC->TextOut(iQuantityPos, iRowPos, "Quantity");
    pDC->TextOut(iStoragePos, iRowPos, "Storage Life");

    // Create a space between the column heading and the text.
    iRowPos += iTextHeight;
    pDC->MoveTo(iRecNumPos, iRowPos);
    pDC->LineTo(oDrawRect.Width() - iRecNumPos, iRowPos);
    iRowPos += 20;

    // Select our text font into the device context.
    pDC->SelectObject(&oTextFont);

	// Determine the row height.
	iTextHeight = 20 + pDC->GetOutputTextExtent("Xy").cy;

	// Print the records in a loop.
	while (iRowCount < m_dataGrid1.GetVisibleRows())
	{

        // Display the current record number.
        itoa(iRowCount, lpstrRow, 10);
        cLine = lpstrRow;
        pDC->TextOut(iRecNumPos, iRowPos, cLine);

		// Print the data.
		m_dataGrid1.SetRow(iRowCount - 1);
		m_dataGrid1.SetCol(0);
		pDC->TextOut(iFoodIDPos, iRowPos, m_dataGrid1.GetText());
		m_dataGrid1.SetCol(1);
		pDC->TextOut(iNamePos, iRowPos, m_dataGrid1.GetText());
		m_dataGrid1.SetCol(2);
		if (m_dataGrid1.GetText() == "-1")
			pDC->TextOut(iPerishablePos, iRowPos, "Yes");
		else
			pDC->TextOut(iPerishablePos, iRowPos, "No");
		m_dataGrid1.SetCol(6);
		pDC->TextOut(iPricePos, iRowPos, "$" + m_dataGrid1.GetText());
		m_dataGrid1.SetCol(4);
		pDC->TextOut(iPurchasePos, iRowPos, m_dataGrid1.GetText());
		m_dataGrid1.SetCol(5);
		pDC->TextOut(iQuantityPos, iRowPos, m_dataGrid1.GetText());
		m_dataGrid1.SetCol(3);
		pDC->TextOut(iStoragePos, iRowPos, m_dataGrid1.GetText());
	
		// Advance the row.
		iRowPos += iTextHeight;
		iRowCount ++;
	}
    
	//Perform the default action
	COleDBRecordView::OnPrint(pDC, pInfo);
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品婷婷伊人一区三区三| 国产91在线|亚洲| 国产精品国产成人国产三级| 日韩免费电影网站| 制服丝袜日韩国产| 在线不卡中文字幕播放| 在线看日韩精品电影| 色狠狠色狠狠综合| 色婷婷久久99综合精品jk白丝| 色悠悠久久综合| 欧美视频一区二区三区在线观看| 在线观看视频一区二区欧美日韩| 91久久线看在观草草青青| 91成人免费网站| 91精品国产91综合久久蜜臀| 欧美一级二级三级蜜桃| 久久午夜色播影院免费高清| 国产嫩草影院久久久久| 椎名由奈av一区二区三区| 亚洲天堂成人在线观看| 亚洲gay无套男同| 久久国产三级精品| 国产精品12区| 色婷婷av一区二区三区大白胸 | 亚洲精品一区二区在线观看| 精品国产成人在线影院 | av一区二区三区在线| 99re这里只有精品首页| 欧美日韩高清影院| 精品国产免费久久| 自拍偷拍亚洲激情| 日韩福利视频导航| 国产91丝袜在线18| 欧美最猛性xxxxx直播| 91精品国产丝袜白色高跟鞋| 亚洲国产精品v| 亚洲一卡二卡三卡四卡无卡久久| 午夜影视日本亚洲欧洲精品| 国产成人免费视频网站| 色婷婷av一区| 国产欧美一区二区三区在线老狼| 一区二区三区免费观看| 黑人巨大精品欧美黑白配亚洲| 不卡av在线网| 精品美女在线播放| 麻豆精品一二三| 99精品国产热久久91蜜凸| 欧美福利电影网| 亚洲私人黄色宅男| 久久国产精品第一页| 在线视频你懂得一区二区三区| 欧美成va人片在线观看| 亚洲精品大片www| 国产成人aaa| 欧美一区二区三区播放老司机| 亚洲少妇中出一区| 成人在线一区二区三区| 精品裸体舞一区二区三区| 亚洲第一福利一区| 一本色道**综合亚洲精品蜜桃冫| 久久先锋资源网| 久久精品国产亚洲5555| 欧美色图免费看| 一区二区三区在线观看欧美| 成人晚上爱看视频| 国产女人18毛片水真多成人如厕| 麻豆国产精品777777在线| 欧美精品一二三| 亚洲午夜久久久| 欧美中文字幕一区二区三区| 亚洲欧洲三级电影| 99视频国产精品| 亚洲欧洲在线观看av| 成人高清免费在线播放| 亚洲国产精品高清| 成人免费视频app| 欧美高清一级片在线观看| 国产乱码精品1区2区3区| 精品国产凹凸成av人导航| 蜜臀av一区二区| 日韩女优视频免费观看| 久久精品国产精品青草| 精品福利二区三区| 国产69精品一区二区亚洲孕妇| 久久精品一区八戒影视| 国产91丝袜在线播放0| 欧美国产97人人爽人人喊| 成人黄色在线看| 亚洲免费伊人电影| 欧美日韩一区二区电影| 五月婷婷色综合| 欧美绝品在线观看成人午夜影视| 亚洲伦理在线免费看| 欧美日免费三级在线| 琪琪一区二区三区| 国产亚洲人成网站| 91麻豆精东视频| 天天综合网 天天综合色| 日韩精品在线一区二区| 国产91在线|亚洲| 一二三区精品视频| 日韩一区二区三免费高清| 国产乱一区二区| 亚洲女与黑人做爰| 日韩一区二区三区高清免费看看 | 久久美女高清视频| 99久久99久久精品国产片果冻| 一片黄亚洲嫩模| 精品日韩欧美一区二区| 99视频精品在线| 日韩av电影天堂| 国产精品乱码人人做人人爱 | 欧美tickling网站挠脚心| 国产大片一区二区| 亚洲妇熟xx妇色黄| 国产亚洲精品超碰| 欧美电影在线免费观看| 国产黄色精品网站| 日韩激情av在线| 自拍偷拍欧美激情| 欧美成人在线直播| 欧美系列日韩一区| 粉嫩高潮美女一区二区三区| 亚洲成人黄色影院| 亚洲三级视频在线观看| 精品少妇一区二区三区视频免付费| 成人免费视频视频在线观看免费| 日韩经典中文字幕一区| 亚洲免费视频成人| 亚洲国产精品成人综合| 精品三级在线看| 欧美日韩视频在线第一区 | 一区二区日韩电影| 精品少妇一区二区三区免费观看| 91浏览器在线视频| 成人免费视频播放| 国产在线观看一区二区| 亚洲综合男人的天堂| 欧美国产一区二区在线观看| 日韩欧美黄色影院| 在线不卡a资源高清| 色视频一区二区| 99久久精品国产一区| 国产成人免费视频精品含羞草妖精| 日韩主播视频在线| 性做久久久久久免费观看| 伊人开心综合网| 亚洲视频在线一区二区| 中文字幕制服丝袜成人av| 国产亚洲综合色| 日本一区二区综合亚洲| 久久久久久日产精品| 精品国产一区二区三区av性色 | 91亚洲精华国产精华精华液| 国产白丝精品91爽爽久久| 韩国精品主播一区二区在线观看| 免费观看91视频大全| 日本欧美一区二区| 另类中文字幕网| 久久国产福利国产秒拍| 精品在线播放午夜| 国产麻豆成人精品| 国产99久久久国产精品免费看| 国产成人亚洲综合色影视| 国产精品一区二区久激情瑜伽| 国产伦精品一区二区三区免费迷 | 欧洲精品中文字幕| 欧洲精品在线观看| 337p亚洲精品色噜噜噜| 精品伦理精品一区| 日本不卡视频在线观看| 日产国产欧美视频一区精品| 久久电影网站中文字幕| 国产91丝袜在线18| 欧洲精品中文字幕| 欧美一区二区网站| 久久久99精品免费观看不卡| 中文av一区二区| 亚洲成年人影院| 另类调教123区| 成人av综合在线| 欧美日韩高清影院| 精品第一国产综合精品aⅴ| 国产精品久99| 亚洲不卡av一区二区三区| 精品一区二区三区免费| 99久久综合国产精品| 8v天堂国产在线一区二区| 久久久久88色偷偷免费| 夜夜操天天操亚洲| 久久疯狂做爰流白浆xx| 一本久道久久综合中文字幕| 日韩欧美一区在线观看| 国产精品黄色在线观看| 日韩av电影免费观看高清完整版| 成人免费视频视频| 精品国产一区二区亚洲人成毛片| 亚洲婷婷在线视频| 国产高清精品网站| 91精品国产欧美一区二区18|