Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

return array or vector TCAHR of windows registry key subkeys c++

i have this code in a c void function to get and print subkeys of a windows registry key:
[code]TCHAR achKey[MAX_KEY_LENGTH]; // buffer for subkey name
retCode = RegQueryInfoKey(
hKey, // key handle
achClass, // buffer for class name
&cchClassName, // size of class string
NULL, // reserved
&cSubKeys, // number of subkeys
&cbMaxSubKey, // longest subkey size
&cchMaxClass, // longest class string
&cValues, // number of values for this key
&cchMaxValue, // longest value name
&cbMaxValueData, // longest value data
&cbSecurityDescriptor, // security descriptor
&ftLastWriteTime); // last write time

// Enumerate the subkeys, until RegEnumKeyEx fails.

if (cSubKeys)
{
printf( "
Number of subkeys: %d
", cSubKeys);

for (i=0; i getSubKeys(HKEY key)
{
vector> subkeys;
....
for (i=0; i(achKey));
}
....
return subkeys;
}
[/code]
with this change it works but at t_main function when i try to list the vector to the console just show eight(the number of subkeys is correct) numbers like 65000 the same value for the eight vector elements, where's the problem or how can i compile with your code, thanks a lot

thanks

Sign In or Register to comment.