07-11-2000 10:45 AM
04-21-2008 10:19 AM
04-21-2008 11:54 AM
04-22-2008 07:29 AM
04-22-2008 09:17 AM
I'm probably mistaken but it seems to be impossible to enumerate subkeys with NI toolbox (CVI 7.0).
A good clue : http://msdn2.microsoft.com/en-us/library/ms724256.aspx (but it's not clear, two parameters are IN/OUT !)
Here is a good exemple using SDK with explanation (I hope usefull). I've also attached the file.
#include<windows.h>
void main(void)
{
int iStatus = 0;
HKEY handleKey = NULL;
char tcSubKeyName[255];
int iSubKeyBufferLen = 255; // Very important for RegEnumKeyEx calling, you need to give it tcSubKeyName buffer lengh. After you'll get returned lenght
char tcClass[255];
int iClassBufferLen = 255;
FILETIME fsLastWriteTime;
iStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Enum\\PCI", 0, KEY_READ, &handleKey);
// RegQueryInfoKey() may give interesting information about sunkeys
if(handleKey != NULL)
{
// Reading first one
iStatus = RegEnumKeyEx(handleKey, 0, tcSubKeyName, &iSubKeyBufferLen, NULL, tcClass, &iClassBufferLen, &fsLastWriteTime);
// ... should add no error test to detect the end
// Reading second one
iSubKeyBufferLen = 255;
iClassBufferLen = 255;
iStatus = RegEnumKeyEx(handleKey, 1, tcSubKeyName, &iSubKeyBufferLen, NULL, tcClass, &iClassBufferLen, &fsLastWriteTime);
// ... should add no error test to detect the end
// Readin... now you should make a loop 😉
RegCloseKey(handleKey);
handleKey = NULL;
}
}
04-22-2008 10:43 AM