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

📄 odbctransdoc.cpp

📁 VC++高级编程技巧与示例
💻 CPP
字号:
// ODBCTransDoc.cpp : implementation of the CODBCTransDoc class
//

#include "stdafx.h"
#include "ODBCTrans.h"

#include "ODBCTransDoc.h"

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

/////////////////////////////////////////////////////////////////////////////
// CODBCTransDoc

IMPLEMENT_DYNCREATE(CODBCTransDoc, CDocument)

BEGIN_MESSAGE_MAP(CODBCTransDoc, CDocument)
	//{{AFX_MSG_MAP(CODBCTransDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CODBCTransDoc construction/destruction

CODBCTransDoc::CODBCTransDoc()
{
	// TODO: add one-time construction code here
//●
    m_pSet=new CDataset;
//●
}

CODBCTransDoc::~CODBCTransDoc()
{
//●
	if(m_pSet!=NULL)
	{
		if(m_pSet->IsOpen())
		{
			m_pSet->Close();
		}
		delete m_pSet;
	}
//●
}

BOOL CODBCTransDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)
//●
	m_pSet->Open();
//●
	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CODBCTransDoc serialization

void CODBCTransDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CODBCTransDoc diagnostics

#ifdef _DEBUG
void CODBCTransDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CODBCTransDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CODBCTransDoc commands

⌨️ 快捷键说明

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