00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #if !defined(__CCREGISTRY_H__)
00028 #define __CCREGISTRY_H__
00029
00030 #if _MSC_VER > 1000
00031 #pragma once
00032 #endif // _MSC_VER > 1000
00033
00034 #include "CCTChar.h"
00035 #include <tchar.h>
00036
00047 class CCRegistry
00048 {
00049 public:
00050
00052 enum RegistryOperation
00053 {
00054 OpenKey,
00055 QueryValueNull,
00056 QueryValue,
00057 WrongType,
00058 SizeZero,
00059 CreateKey,
00060 SetValue,
00061 None
00062 };
00063
00064
00065
00067 static std::tstring GetString(HKEY hKey, LPCTSTR pPath, LPCTSTR pName, bool* pSuccess = NULL, DWORD dwExtraFlags = 0);
00069 static bool SetString(HKEY hKey, LPCTSTR pPath, LPCTSTR pName, LPCTSTR pValue);
00070
00072 static bool GetBinary(HKEY hKey, LPCTSTR pPath, LPCTSTR pName, unsigned char*& pBuffer, int& nBytes);
00074 static bool SetBinary(HKEY hKey, LPCTSTR pPath, LPCTSTR pName, unsigned char* pBuffer, int nBytes);
00075
00077 static DWORD GetNumber(HKEY hKey, LPCTSTR pPath, LPCTSTR pName, bool* pSuccess = NULL);
00079 static bool SetNumber(HKEY hKey, LPCTSTR pPath, LPCTSTR pName, DWORD dwValue);
00080
00081
00083 static bool TestWrite(HKEY hKey, LPCTSTR pPath);
00084
00089 static RegistryOperation GetLastErrorOperation() {return eLastErrorOp;};
00094 static DWORD GetLastError() {return dwLastError;};
00095
00096 protected:
00098 static enum RegistryOperation eLastErrorOp;
00100 static DWORD dwLastError;
00101 };
00102
00103 #endif // !defined(__CCREGISTRY_H__)