Okay well I redid the code and now its working.
Code:
int main ()
{
HKEY keyHandle;
char rgValue [1024];
char fnlRes [1024];
DWORD size1;
DWORD Type;
if( RegOpenKeyEx( HKEY_LOCAL_MACHINE,
"SOFTWARE\\somesoft\\app",0,
KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS)
{
size1=1023;
RegQueryValueEx( keyHandle, "Path", NULL, &Type,
(LPBYTE)rgValue,&size1);
printf( "Your path is %s\n", rgValue );
}
else strcpy(fnlRes,"Somesoft is not installed on your computer!");
RegCloseKey(keyHandle);
std::cin.get();
return 0;
}
But now I want to go to that directory I tryed using
And as I expected it didn't work any help?
EDIT: fixed every thing works