LWQ
2025-08-13 be72a344954f46a40c96848071a10996fc4bf030
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// HMRegistery.h: interface for the CRegist class.
//
//////////////////////////////////////////////////////////////////////
 
#if !defined(AFX_REGISTERY_H__BFF1B539_B69C_46E1_8575_A595F5AC4D29__INCLUDED_)
#define AFX_REGISTERY_H__BFF1B539_B69C_46E1_8575_A595F5AC4D29__INCLUDED_
 
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
 
#include "BasedConfig.h"
 
class CRegistery : public CBasedConfig
{
public:
    CRegistery();
    virtual ~CRegistery();
 
    // Setting °ª Àû¿ë ÇÔ¼ö.
    BOOL    Initialize(HKEY hKey = HKEY_CURRENT_USER, CString strKey = _T(""), CString strFilename = _T(""));
 
    //////////////////////////////////////////////////////////////////////////
    BOOL    SetItemValue(CString strName,  CString& strValue);
    BOOL    SetItemValue(CString strName, int& nValue);
    BOOL    SetItemValue(CString strName, unsigned short &sValue);
    BOOL    SetItemValue(CString strName, double& dValue);
    
    BOOL    SetItemValue(int nIdx, CString strName, CString& strValue);
    BOOL    SetItemValue(int nIdx, CString strName, int& nValue);
    BOOL    SetItemValue(int nIdx, CString strName, unsigned short &sValue);
    BOOL    SetItemValue(int nIdx, CString strName, double& dValue);
    
    //////////////////////////////////////////////////////////////////////////
    int        GetItemValue(CString strName, CString& strValue, CString strDefault = _T(""));
    int        GetItemValue(CString strName, int& nValue, int nDefault = 0);
    int        GetItemValue(CString strName, unsigned short &nValue, unsigned short sDefault = 0);
    int        GetItemValue(CString strName, double& dValue, double dDefault = 0);
    
    int        GetItemValue(int nIdx, CString strName, CString& strValue, CString strDefault = _T(""));
    int        GetItemValue(int nIdx, CString strName, int& nValue, int nDefault = 0);
    int        GetItemValue(int nIdx, CString strName, unsigned short &nValue, unsigned short sDefault = 0);
    int        GetItemValue(int nIdx, CString strName, double& dValue, double dDefault = 0);
    
    BOOL    RemoveAllItem();
    BOOL    RemoveItem(CString strName);
    BOOL    RemoveItem(int nIdx, CString strName);
 
    BOOL    WriteToFile();
 
    void    SetRewriteMode(BOOL bRewrite);
    BOOL    GetRewriteMode();
    
 
    // OhByungGil  Modify -> LogFile Write
    void    SetLogMode(BOOL bMode);
    BOOL    GetLogMode();
    void    SetLogFilePath(CString strLogFilePath);
    CString GetLogFilePath();
 
protected:
    HKEY        m_hKey;
    CString        m_strKey;
    
/*    BOOL    DeleteKey(HKEY hKey, LPCTSTR lpKey);
    
    //////////////////////////////////////////////////////////////////////////
    // ÀÓÀÇ »ç¿ë °¡´É ÇÔ¼ö.
    BOOL    WriteString(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, LPCTSTR lpData);
    BOOL    WriteDouble(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, double dData);
    BOOL    WriteInt(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, int nData);
    BOOL    ReadString(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, LPTSTR lpRet, DWORD nSize);
    BOOL    ReadDouble(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, double dDefault, double& dValue);
    BOOL    ReadInt(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, int nDefault, int& nValue);
    
    BOOL    WriteString(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, int nIdx, LPCTSTR lpData);
    BOOL    WriteDouble(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, int nIdx, double dData);
    BOOL    WriteInt(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, int nIdx, UINT nData);
    BOOL    ReadString(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, int nIdx, LPTSTR lpRet, DWORD nSize);
    BOOL    ReadDouble(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, int nIdx, double dDefault, double& dValue);
    BOOL    ReadInt(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValue, int nIdx, int nDefault, int& nValue);
    
    BOOL    DeleteValue(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValueName);
    BOOL    DeleteValue(HKEY hKey, LPCTSTR lpKey, LPCTSTR lpValueName, int nIdx);
*/
    //////////////////////////////////////////////////////////////////////////
};
 
#endif // !defined(AFX_REGISTERY_H__BFF1B539_B69C_46E1_8575_A595F5AC4D29__INCLUDED_)