Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1994, Microsoft Corporation.
  4. //
  5. // File: pdbexcpt.hxx
  6. //
  7. // Contents: Exception package for propagating errors posted via Ole-DB
  8. // error mechanism.
  9. //
  10. // History: 08-May-97 KrishnaN Created.
  11. //
  12. //----------------------------------------------------------------------------
  13. #pragma once
  14. //+---------------------------------------------------------------------------
  15. //
  16. // Class: CPostedOleDBException
  17. //
  18. // Purpose: Exception class containing message numbers referring to
  19. // keys within query.dll
  20. //
  21. // History: 08-May-97 KrishnaN Created.
  22. //
  23. //----------------------------------------------------------------------------
  24. class CPostedOleDBException : public CException
  25. {
  26. public:
  27. CPostedOleDBException( SCODE sc, int iErrorClass, IErrorInfo *pErrorInfo )
  28. : CException(sc),
  29. _iErrorClass( iErrorClass )
  30. {
  31. xErrorInfo.Set(pErrorInfo);
  32. pErrorInfo->AddRef();
  33. }
  34. CPostedOleDBException( CPostedOleDBException & src)
  35. : CException(src.GetErrorCode()),
  36. _iErrorClass (src._iErrorClass)
  37. {
  38. xErrorInfo.Set(src.AcquireErrorInfo());
  39. }
  40. IErrorInfo * AcquireErrorInfo () { return xErrorInfo.Acquire(); }
  41. int GetErrorClass() { return _iErrorClass; }
  42. private:
  43. XInterface<IErrorInfo> xErrorInfo;
  44. int _iErrorClass;
  45. };