I'm converting code from VC++6 to VC#2002 and have encountered my first roadblock with respect to using "RegEnumKeyEx" to compare the time stamps of registry
keys (when they were created to find the newest one).
Currently I do the following in VC++6 to determine which key is the newest:
So my problem is how to accomplish this in C#?Code:FILETIME ft, mrft; // mr = most recent mrft.dwLowDateTime = 0; mrft.dwHighDateTime = 0; while (ERROR_SUCCESS == (rc = RegEnumKeyEx( hkBase, Index++, Name, &Length, NULL, NULL, NULL, &ft)))) { if (CompareFileTime (&mrft, &ft)) { mrft.dwLowDateTime = ft.dwLowDateTime; mrft.dwHighDateTime = ft.dwHighDateTime; newestName = Name; } } ... ...
Is there an alternative approach I should be using under the DotNet platform for C#? Or is there a way I can include "RegEnumKeyEx" somehow (like I would do a DECLARE with coredll.dll in VB or something) in the C# project so I can use the function as-is (continue the same way I was before)?
Any help would be greatly appreciated.
Thanks,


Reply With Quote
