Please help with registry access
Hello,
I am trying to convert Visual Basic Registry Access to C++ functions and i have a lot of errors about conversions but i have no idea how to fix them.
PHP Code:
char* RegQueryStringValue (HKEY__* key, char* cValue)
{
ulong* iResult;
ulong* iValueType;
ulong iBuffSize;
unsigned char zBuff;
iResult = RegQueryValueEx (key, cValue, NULL, iValueType, &zBuff, iBuffSize);
// if (iResult == 0){
// if (iValueType == 1){
// char zBuff[iBuffSize];
// iResult = RegQueryValueEx (key, cValue, NULL, iValueType, &zBuff, iBuffSize);
// }
// }
}
char* GetSetting(HKEY__* key, char* cPath[], char* cValue[])
{
//Read a setting from registry
unsigned long int hKey;
unsigned short int hDataType;
char zBuff[256];
RegOpenKey (key, cPath*, hKey);
strcpy(zBuff, RegQueryStringValue (&hKey, cValue);
RegCloseKey (hKey);
}
I am a newbie to C++. Please help me.
Thanks, :rolleyes:
Re: Please help with registry access
I fixed errors, but I'm too lazy to explain them now.
Quote:
Originally posted by made_of_asp
Hello,
I am trying to convert Visual Basic Registry Access to C++ functions and i have a lot of errors about conversions but i have no idea how to fix them.
PHP Code:
char* RegQueryStringValue (HKEY key, char* cValue)
{
LONG iResult;
DWORD iValueType;
DWORD iBuffSize;
BYTE zBuff[100];
iResult = RegQueryValueEx (key, cValue, NULL, &iValueType, zBuff, &iBuffSize);
// if (iResult == 0){
// if (iValueType == 1){
// char zBuff[iBuffSize];
// iResult = RegQueryValueEx (key, cValue, NULL, iValueType, &zBuff, iBuffSize);
// }
// }
}
char* GetSetting(HKEY key, char* cPath, char* cValue)
{
//Read a setting from registry
HKEY hKey;
unsigned short int hDataType;
char zBuff[256];
RegOpenKey (key, cPath, &hKey);
strcpy(zBuff, RegQueryStringValue (hKey, cValue); // function does not exist
RegCloseKey (hKey);
}
I am a newbie to C++. Please help me.
Thanks, :rolleyes: