Files
envi-code/SourceCode/Code2026/inc/AdsXRx/RegProperty.h
T
2026-09-28 15:28:50 +08:00

104 lines
2.2 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, SH Software Co. Ltd.
// = FileName : CRegProperty.h
// = Version : ver2.0
// = Author : zjq
// = CreateDate : 2002-09-09
// = Description: ÀàµÄÉùÃ÷
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#ifndef _REGPROPERTY_H_
#define _REGPROPERTY_H_
#ifndef _RegObject_H_
#include "RegObject.h"
#endif
class GEOAPI CRegProperty : public CXRegObject
{
public :
CRegProperty ( const CRegProperty &);
CRegProperty ( LPCTSTR pszRootKey, LPCTSTR pszObjKey);
CRegProperty ( LPCTSTR pszRootKey, LPCTSTR pszObjKey, double dVersion);
virtual ~CRegProperty ();
virtual bool Init ();
virtual bool Read ();
virtual bool Store ();
CRegProperty & operator = ( const CRegProperty & );
CString GetVersion () const;
CString GetRootKey ( bool bVersionized) const;
void SetRootKey ( LPCTSTR pszRootKey , double dVersion );
void Register ( CXRegObject * obj );
void Unregister( CXRegObject * obj );
bool LookUp ( CXRegObject * pobjLook , int *pIndex = NULL );
CXRegObject * LookUp ( PRPHANDLE hSubkey );
PRPHANDLE CreateSubKey ( LPCTSTR pszSubkey , bool bVersionized = FALSE , LPCTSTR pszClassname = NULL );
CXRegObject * GeCRegObject ( PRPHANDLE Handle );
bool AttachValue ( PRPHANDLE hSubkey , int *nValue , LPCTSTR pszName );
bool AttachValue ( PRPHANDLE hSubkey , bool *bValue , LPCTSTR pszName );
bool AttachValue ( PRPHANDLE hSubkey , long *lValue , LPCTSTR pszName );
bool AttachValue ( PRPHANDLE hSubkey , DWORD *dwValue , LPCTSTR pszName );
bool AttachValue ( PRPHANDLE hSubkey , CString *strValue , LPCTSTR pszName );
typedef enum
{
RegPTypeNONE,
RegPTypeLOCAL_MACHINE,
RegPTypeUSERS
} RegPropertyType ;
static bool ReadValue ( HKEY key,
const TCHAR * pszKey,
const TCHAR * pszValuename,
BYTE *pBuffer,
DWORD BufferSize);
protected :
CRegProperty ();
private:
void init ();
void clear ();
private:
bool m_bDeleting;
CString m_RootKey;
CString m_Version;
CString m_VersionKey;
CString m_CommonKey;
CPtrArray m_CRegObjectArray;
RegPropertyType m_RegPropertyType;
};
#endif