Click here to Skip to main content
15,898,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC -Help Pin
imran.prdc27-May-14 19:46
imran.prdc27-May-14 19:46 
AnswerRe: MFC -Help Pin
_Flaviu27-May-14 20:24
_Flaviu27-May-14 20:24 
AnswerRe: MFC -Help Pin
Richard MacCutchan27-May-14 21:14
mveRichard MacCutchan27-May-14 21:14 
GeneralRe: MFC -Help Pin
imran.prdc27-May-14 21:16
imran.prdc27-May-14 21:16 
GeneralRe: MFC -Help Pin
imran.prdc27-May-14 21:16
imran.prdc27-May-14 21:16 
GeneralRe: MFC -Help Pin
Richard MacCutchan27-May-14 21:29
mveRichard MacCutchan27-May-14 21:29 
GeneralRe: MFC -Help Pin
Stefan_Lang27-May-14 21:30
Stefan_Lang27-May-14 21:30 
QuestionRegQueryValueEx returns wrong value Pin
vks1125-May-14 23:57
vks1125-May-14 23:57 
Hi all,

While debugging the following code,
inline LONG CRegKey::QueryValue(LPTSTR szValue, LPCTSTR lpszValueName, DWORD* pdwCount)
{
	ATLASSERT(pdwCount != NULL);
	DWORD dwType = NULL;
	LONG lRes = RegQueryValueEx(m_hKey, (LPTSTR)lpszValueName, NULL, &dwType,
		(LPBYTE)szValue, pdwCount);
	ATLASSERT((lRes!=ERROR_SUCCESS) || (dwType == REG_SZ) ||
			 (dwType == REG_MULTI_SZ) || (dwType == REG_EXPAND_SZ));
	return lRes;
}


Here the value for (LPTSTR)lpszValueName is 'SQLPath' and the value which returns for 'szValue' in RegQueryValueEx method is “c:\Program Files (x86)\Microsoft SQL Server\100\Tools\” which should be “c:\Program Files\Microsoft SQL Server\100\Tools\”

We have noted that the data value for SQLPath in RegistryKey "SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\ClientSetup" is “c:\Program Files\Microsoft SQL Server\100\Tools\”

Could anybody please tell why RegQueryValueEx method is returning a wrong value “c:\Program Files (x86)\Microsoft SQL Server\100\Tools\” which should be “c:\Program Files\Microsoft SQL Server\100\Tools\”

Thanks in advance
AnswerRe: RegQueryValueEx returns wrong value Pin
Richard MacCutchan26-May-14 0:26
mveRichard MacCutchan26-May-14 0:26 
GeneralRe: RegQueryValueEx returns wrong value Pin
vks1126-May-14 23:24
vks1126-May-14 23:24 
AnswerRe: RegQueryValueEx returns wrong value Pin
Freak3026-May-14 3:13
Freak3026-May-14 3:13 
GeneralRe: RegQueryValueEx returns wrong value Pin
vks1126-May-14 23:23
vks1126-May-14 23:23 
AnswerRe: RegQueryValueEx returns wrong value Pin
Randor 26-May-14 14:06
professional Randor 26-May-14 14:06 
GeneralRe: RegQueryValueEx returns wrong value Pin
vks1126-May-14 23:23
vks1126-May-14 23:23 
GeneralProblem in reading BMP Header Pin
Benjamin Bruno25-May-14 19:03
Benjamin Bruno25-May-14 19:03 
GeneralRe: Problem in reading BMP Header Pin
Richard MacCutchan25-May-14 21:48
mveRichard MacCutchan25-May-14 21:48 
GeneralRe: Problem in reading BMP Header Pin
Heng Xiangzhong26-May-14 15:11
Heng Xiangzhong26-May-14 15:11 
GeneralRe: Problem in reading BMP Header Pin
CPallini26-May-14 22:01
mveCPallini26-May-14 22:01 
QuestionC Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Office 36525-May-14 17:03
Office 36525-May-14 17:03 
AnswerRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Richard MacCutchan25-May-14 21:43
mveRichard MacCutchan25-May-14 21:43 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Office 36525-May-14 22:37
Office 36525-May-14 22:37 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Richard MacCutchan25-May-14 22:52
mveRichard MacCutchan25-May-14 22:52 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Office 36526-May-14 0:14
Office 36526-May-14 0:14 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Richard MacCutchan26-May-14 0:23
mveRichard MacCutchan26-May-14 0:23 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Office 36526-May-14 18:48
Office 36526-May-14 18:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.