Source code of Windows XP (NT5)
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.

113 lines
2.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1994, Microsoft Corporation.
  4. //
  5. // File: ixsexcpt.hxx
  6. //
  7. // Contents: Message exception package for the Index server SSO
  8. //
  9. // History: 04 Nov 1996 AlanW Created
  10. //
  11. //----------------------------------------------------------------------------
  12. #pragma once
  13. enum
  14. {
  15. eDefaultError = 0,
  16. eIxssoError,
  17. eParseError,
  18. ePlistError,
  19. };
  20. //+---------------------------------------------------------------------------
  21. //
  22. // Class: CIxssoException
  23. //
  24. // Purpose: Exception class containing message numbers referring to
  25. // keys within ixsso.dll
  26. //
  27. // Notes:
  28. //
  29. // History: 04 Nov 1996 AlanW Created
  30. //
  31. //----------------------------------------------------------------------------
  32. class CIxssoException : public CException
  33. {
  34. public:
  35. CIxssoException( long lError, ULONG ulErrorIndex )
  36. : _ulErrorIndex(ulErrorIndex), CException(lError)
  37. {
  38. }
  39. ULONG GetErrorIndex() const { return _ulErrorIndex; }
  40. # if !defined(NATIVE_EH)
  41. // inherited methods
  42. EXPORTDEF virtual int WINAPI IsKindOf( const char * szClass ) const
  43. {
  44. if( strcmp( szClass, "CIxssoException" ) == 0 )
  45. return TRUE;
  46. else
  47. return CException::IsKindOf( szClass );
  48. }
  49. # endif // !defined(NATIVE_EH)
  50. private:
  51. ULONG _ulErrorIndex;
  52. };
  53. //+---------------------------------------------------------------------------
  54. //
  55. // Class: CPostedOleDBException
  56. //
  57. // Purpose: Exception class containing all the error information acquired
  58. // from the Ole DB and Content Index error lookup services. This
  59. // information is passed to the SSO error handling service so that
  60. // the SSO consumer can get everything in one place.
  61. //
  62. // Notes:
  63. //
  64. // History: 06 May 1997 KrishnaN Created
  65. //
  66. //----------------------------------------------------------------------------
  67. class CPostedOleDBException : public CException
  68. {
  69. public:
  70. CPostedOleDBException( SCODE sc, IErrorInfo *pErrorInfo )
  71. : CException(sc)
  72. {
  73. xErrorInfo.Set(pErrorInfo);
  74. pErrorInfo->AddRef();
  75. }
  76. CPostedOleDBException( CPostedOleDBException & src)
  77. : CException(src.GetErrorCode())
  78. {
  79. xErrorInfo.Set(src.AcquireErrorInfo());
  80. }
  81. IErrorInfo * AcquireErrorInfo () { return xErrorInfo.Acquire(); }
  82. # if !defined(NATIVE_EH)
  83. // inherited methods
  84. EXPORTDEF virtual int WINAPI IsKindOf( const char * szClass ) const
  85. {
  86. if( strcmp( szClass, "CPostedOleDBException" ) == 0 )
  87. return TRUE;
  88. else
  89. return CException::IsKindOf( szClass );
  90. }
  91. # endif // !defined(NATIVE_EH)
  92. private:
  93. XInterface<IErrorInfo> xErrorInfo;
  94. };