can anyone point what is wrong with my RegQuerryEx() function? Altough it return 0 :|

char buff[3] = {0};
	DWORD size = sizeof(buff);
	DWORD type;

	if(RegOpenKeyEx(HKEY_CURRENT_USER , "Software\\vBx" , 0 , KEY_QUERY_VALUE , &hkey) == ERROR_SUCCESS)
	{
		if(RegQueryValueEx(hkey , "log" , NULL , &type , (LPBYTE)buff , &size) == ERROR_SUCCESS)
		{
			if(strncmp(buff , "vBx" , 3))
			{
				cout << "i was here";
			}
		}else
			cout << GetLastError() << endl;
	}

it never reaches the if() part

c
it never reaches the if() part

Which of the both?

RegQuerryEx() .....return GetLastError() -> 0 ....so it doesnt to the comparation :|

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.