thanks Iain Clarke it's working fine......... :)
adhilingam
Posts
-
how to add Ip address in the registry value -
how to add Ip address in the registry valuethanks Mark Salsbery the above sample program is working fine, am able to enter the Ip Address properly. thanks a lot :)
-
how to add Ip address in the registry valuehi i need to add Ip Address as the value for the registry. Example,like this Registry Name = public Registry Type = REG_SZ Registry Data = 10.20.40.80 but using below code am able to add only one value as "1" #include "stdafx.h" #include <windows.h> #include <stdio.h> int _tmain(int argc, _TCHAR* argv[]) { unsigned char szStr[20]="12.45.67.89"; HKEY hKey; // opening a subkey, then creating and setting a value if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT ("SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\s1"), 0, KEY_ALL_ACCESS, &hKey)!=ERROR_SUCCESS) printf("\nError opening the desired subkey (doesn't exist?).\n"); else { if (RegSetValueEx(hKey, TEXT("public"), NULL, REG_SZ, szStr, sizeof (szStr)) ==ERROR_SUCCESS) printf("\nThe value of the key was set successfully.\n"); else printf("\nError setting the value of the key.\n"); } RegCloseKey(hKey); return 0; } Output am getting in the registry data field is " 9" could you please help me regarding the above issue.
-
how to get the subkey value using c++Hi In our application the subkey will be dynamically changed, so we can't give subkey name directly. so based on the subkey name, the corresponding subkey value should be retrived. if possible please provide me a sample program to get the subkey values.
-
how to get registry subkey value using c++Hi Am new to the registry concept in C++, I need help regarding registry subkey concepts. If possible please solve my issue with example source code to get registry subkey value.