Update ooo320-m1
[ooovba.git] / setup_native / source / win32 / customactions / reg4msdoc / registryexception.cxx
blob5e963eea4ed26c97eca86d38c7dca73bf264f70a
1 // RegistryException.cpp: Implementierung der Klasse RegistryException.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #include "registryexception.hxx"
7 #ifdef _MSC_VER
8 #pragma warning(push, 1) /* disable warnings within system headers */
9 #endif
10 #include <windows.h>
11 #ifdef _MSC_VER
12 #pragma warning(pop)
13 #endif
15 //////////////////////////////////////////////////////////////////////
16 // Konstruktion/Destruktion
17 //////////////////////////////////////////////////////////////////////
19 RegistryException::RegistryException(long ErrorCode) :
20 m_ErrorCode(ErrorCode),
21 m_ErrorMsg(0)
25 /**
27 RegistryException::~RegistryException() throw()
29 if (m_ErrorMsg)
30 LocalFree(m_ErrorMsg);
33 /**
35 const char* RegistryException::what() const throw()
37 FormatMessage(
38 FORMAT_MESSAGE_ALLOCATE_BUFFER |
39 FORMAT_MESSAGE_FROM_SYSTEM |
40 FORMAT_MESSAGE_IGNORE_INSERTS,
41 NULL,
42 m_ErrorCode,
43 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
44 (LPTSTR) &m_ErrorMsg,
46 NULL);
48 return reinterpret_cast<char*>(m_ErrorMsg);
51 /**
53 long RegistryException::GetErrorCode() const
55 return m_ErrorCode;
58 //#######################################
59 // Thrown when a Registry key is accessed
60 // that is closed
61 //#######################################
63 RegistryIOException::RegistryIOException(long ErrorCode) :
64 RegistryException(ErrorCode)
68 //#######################################
69 //
70 //#######################################
72 RegistryNoWriteAccessException::RegistryNoWriteAccessException(long ErrorCode) :
73 RegistryException(ErrorCode)
77 //#######################################
79 //#######################################
81 RegistryAccessDeniedException::RegistryAccessDeniedException(long ErrorCode) :
82 RegistryException(ErrorCode)
86 //#######################################
88 //#######################################
90 RegistryValueNotFoundException::RegistryValueNotFoundException(long ErrorCode) :
91 RegistryException(ErrorCode)
95 //#######################################
97 //#######################################
99 RegistryKeyNotFoundException::RegistryKeyNotFoundException(long ErrorCode) :
100 RegistryException(ErrorCode)
104 //#######################################
106 //#######################################
108 RegistryInvalidOperationException::RegistryInvalidOperationException(long ErrorCode) :
109 RegistryException(ErrorCode)