// MyRegKey.cpp: implementation of the CMyRegKey class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "dicommwl.h" #include "MyRegKey.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CMyRegKey::CMyRegKey() { } CMyRegKey::~CMyRegKey() { } long CMyRegKey::QueryValue(CString &strValue, CString strValueName) { char szValue[1000]; DWORD dwCount = 1000; long lRet; lRet = CRegKey::QueryValue(szValue, (LPSTR)(LPCSTR)strValueName, &dwCount); if (lRet == ERROR_SUCCESS) strValue = szValue; return lRet; } long CMyRegKey::QueryValue(int &nValue, CString strValueName) { DWORD dValue; long lRet; lRet = CRegKey::QueryValue(dValue, (LPSTR)(LPCSTR)strValueName); if (lRet == ERROR_SUCCESS) nValue = dValue; return lRet; } long CMyRegKey::SetValue(int nValue, CString strValueName) { long lRet; DWORD dValue = nValue; lRet = CRegKey::SetValue(dValue, (LPSTR)(LPCSTR)strValueName); return lRet; } long CMyRegKey::SetValue(CString strValue, CString strValueName) { long lRet; lRet = CRegKey::SetValue((LPSTR)(LPCSTR)strValue, (LPSTR)(LPCSTR)strValueName); return lRet; }