Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / setup_native / source / win32 / customactions / reg4msdoc / registryexception.cxx
blobe7e66825ed4be24cccc5c2f83db16131e0c28433
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 // RegistryException.cpp: Implementierung der Klasse RegistryException.
3 //
4 //////////////////////////////////////////////////////////////////////
6 #include "registryexception.hxx"
8 #ifdef _MSC_VER
9 #pragma warning(push, 1) /* disable warnings within system headers */
10 #endif
11 #include <windows.h>
12 #ifdef _MSC_VER
13 #pragma warning(pop)
14 #endif
16 //////////////////////////////////////////////////////////////////////
17 // Konstruktion/Destruktion
18 //////////////////////////////////////////////////////////////////////
20 RegistryException::RegistryException(long ErrorCode) :
21 m_ErrorCode(ErrorCode),
22 m_ErrorMsg(0)
26 RegistryException::~RegistryException() throw()
28 if (m_ErrorMsg)
29 LocalFree(m_ErrorMsg);
32 const char* RegistryException::what() const throw()
34 FormatMessage(
35 FORMAT_MESSAGE_ALLOCATE_BUFFER |
36 FORMAT_MESSAGE_FROM_SYSTEM |
37 FORMAT_MESSAGE_IGNORE_INSERTS,
38 NULL,
39 m_ErrorCode,
40 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
41 (LPTSTR) &m_ErrorMsg,
43 NULL);
45 return reinterpret_cast<char*>(m_ErrorMsg);
48 long RegistryException::GetErrorCode() const
50 return m_ErrorCode;
53 //#######################################
54 // Thrown when a Registry key is accessed
55 // that is closed
56 //#######################################
58 RegistryIOException::RegistryIOException(long ErrorCode) :
59 RegistryException(ErrorCode)
63 RegistryNoWriteAccessException::RegistryNoWriteAccessException(long ErrorCode) :
64 RegistryException(ErrorCode)
68 RegistryAccessDeniedException::RegistryAccessDeniedException(long ErrorCode) :
69 RegistryException(ErrorCode)
73 RegistryValueNotFoundException::RegistryValueNotFoundException(long ErrorCode) :
74 RegistryException(ErrorCode)
78 RegistryKeyNotFoundException::RegistryKeyNotFoundException(long ErrorCode) :
79 RegistryException(ErrorCode)
83 RegistryInvalidOperationException::RegistryInvalidOperationException(long ErrorCode) :
84 RegistryException(ErrorCode)
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */