home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / COMMON / TOOLS / VCM / VCM.MDB / VcmComponentContainer / 14_Cabinet / DBEXCEPT.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-18  |  1.1 KB  |  50 lines

  1. ///////////////////////////////////////////////////////////////////////////
  2. // DBEXCEPT.CPP
  3. //
  4. // This is a part of the Microsoft Foundation Classes and
  5. // Templates (MFC&T).
  6. // Copyright (C) 1998 Microsoft Corporation
  7. // All rights reserved.
  8. //
  9. // This source code is only intended as a supplement to the
  10. // MFC&T Reference and related electronic documentation provided
  11. // with the library.  See these sources for detailed information
  12. // regarding the MFC&T product.
  13. //
  14.  
  15. #include "stdafx.h"
  16. #include "dbexcept.h"
  17.  
  18. IMPLEMENT_DYNAMIC(COLEDBException, CException)
  19.  
  20.  
  21. ///////////////////////////////////////////////////////////////////////////
  22. // COLEDBException
  23.  
  24. COLEDBException::COLEDBException()
  25. {
  26.     m_lpUnk = NULL;
  27. }
  28.  
  29. COLEDBException::COLEDBException(LPUNKNOWN lpUnk, const IID& iid)
  30. {
  31.     m_lpUnk = lpUnk;
  32.     if (m_lpUnk != NULL)
  33.         m_lpUnk->AddRef();
  34.     m_iid = iid;
  35. }
  36.  
  37. COLEDBException::~COLEDBException()
  38. {
  39.     if (m_lpUnk != NULL)
  40.     {
  41.         m_lpUnk->Release();
  42.         m_lpUnk = NULL;
  43.     }
  44. }
  45.  
  46. void AFXAPI AfxThrowOLEDBException(LPUNKNOWN lpUnk, const IID& iid)
  47. {
  48.     THROW(new COLEDBException(lpUnk, iid));
  49. }
  50.