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;
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


Sign In or Register to comment.

Howdy, Stranger!

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