Fixing errors caused by r549.

This commit is contained in:
Birunthan Mohanathas 2010-09-23 08:49:43 +00:00
parent c1fda93526
commit 9da555a187
5 changed files with 344 additions and 334 deletions

View File

@ -53,58 +53,58 @@ CMeasureRegistry::~CMeasureRegistry()
*/
bool CMeasureRegistry::Update()
{
if (!CMeasure::PreUpdate()) return false;
if (!CMeasure::PreUpdate()) return false;
if(m_RegKey != NULL)
if(m_RegKey != NULL)
{
DWORD size = 4096;
WCHAR data[4096];
DWORD type = 0;
if(RegQueryValueEx(m_RegKey,
m_RegValueName.c_str(),
NULL,
(LPDWORD)&type,
(LPBYTE)&data,
(LPDWORD)&size) == ERROR_SUCCESS)
{
DWORD size = 4096;
WCHAR data[4096];
DWORD type = 0;
switch(type)
{
case REG_DWORD:
m_Value = *((LPDWORD)&data);
m_StringValue.erase();
break;
if(RegQueryValueEx(m_RegKey,
m_RegValueName.c_str(),
NULL,
(LPDWORD)&type,
(LPBYTE)&data,
(LPDWORD)&size) == ERROR_SUCCESS)
{
switch(type)
{
case REG_DWORD:
m_Value = *((LPDWORD)&data);
m_StringValue.erase();
break;
case REG_SZ:
case REG_EXPAND_SZ:
case REG_MULTI_SZ:
m_Value = 0.0;
m_StringValue = data;
break;
case REG_SZ:
case REG_EXPAND_SZ:
case REG_MULTI_SZ:
m_Value = 0.0;
m_StringValue = data;
break;
case REG_QWORD:
m_Value = (double)((LARGE_INTEGER*)&data)->QuadPart;
m_StringValue.erase();
break;
case REG_QWORD:
m_Value = (double)((LARGE_INTEGER*)&data)->QuadPart;
m_StringValue.erase();
break;
default: // Other types are not supported
m_Value = 0.0;
m_StringValue.erase();
}
}
else
{
m_Value = 0.0;
m_StringValue.erase();
RegOpenKeyEx(m_HKey, m_RegKeyName.c_str(), 0, KEY_READ, &m_RegKey);
}
default: // Other types are not supported
m_Value = 0.0;
m_StringValue.erase();
}
}
else
{
RegOpenKeyEx(m_HKey, m_RegKeyName.c_str(), 0, KEY_READ, &m_RegKey);
m_Value = 0.0;
m_StringValue.erase();
RegOpenKeyEx(m_HKey, m_RegKeyName.c_str(), 0, KEY_READ, &m_RegKey);
}
}
else
{
RegOpenKeyEx(m_HKey, m_RegKeyName.c_str(), 0, KEY_READ, &m_RegKey);
}
return PostUpdate();
return PostUpdate();
}
/*

View File

@ -102,7 +102,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
{
std::wstring error = L"RecycleType=";
error += type;
error += L" is not valid in measure [" + section + L"].";
error += L" is not valid in measure [";
error += section;
error += L"].";
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}

View File

@ -115,7 +115,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
{
std::wstring error = L"GDICountType=";
error += type;
error += L" is not valid in measure [" + section + L"].";
error += L" is not valid in measure [";
error += section;
error += L"].";
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}

View File

@ -113,7 +113,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
{
std::wstring error = L"SpeedFanScale=";
error += scale;
error += L" is not valid in measure [" + section + L"]." ;
error += L" is not valid in measure [";
error += section;
error += L"].";
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}
@ -130,7 +132,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
{
std::wstring error = L"SpeedFanType=";
error += type;
error += L" is not valid in measure [" + section + L"]." ;
error += L" is not valid in measure [";
error += section;
error += L"].";
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}

View File

@ -209,7 +209,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
{
std::wstring error = L"SysInfoType=";
error += type;
error += L" is not valid in measure [" + section + L"]." ;
error += L" is not valid in measure [";
error += section;
error += L"].";
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}