dbexcept.cpp

来自「Visual C++ 实践与提高--数据库篇的源代码。很好的东西。欢迎下载。」· C++ 代码 · 共 54 行

CPP
54
字号
///////////////////////////////////////////////////////////////////////////
// DBEXCEPT.CPP
//
// This is a part of the Microsoft Foundation Classes and
// Templates (MFC&T).
// Copyright (C) 1998 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// MFC&T Reference and related electronic documentation provided
// with the library.  See these sources for detailed information
// regarding the MFC&T product.
//

#include "stdafx.h"
#include "dbexcept.h"

IMPLEMENT_DYNAMIC(COLEDBException, CException)


///////////////////////////////////////////////////////////////////////////
// COLEDBException

COLEDBException::COLEDBException()
{
	m_lpUnk = NULL;
}

COLEDBException::COLEDBException(LPUNKNOWN lpUnk, const IID& iid)
{
	m_lpUnk = lpUnk;
	if (m_lpUnk != NULL)
		m_lpUnk->AddRef();
	m_iid = iid;
}

COLEDBException::~COLEDBException()
{
	if (m_lpUnk != NULL)
	{
		m_lpUnk->Release();
		m_lpUnk = NULL;
	}
}

void AFXAPI AfxThrowOLEDBException(LPUNKNOWN lpUnk, const IID& iid)
{
	THROW(new COLEDBException(lpUnk, iid));
}


//--------------------------------

//--------------------------------

⌨️ 快捷键说明

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