I am trying to read the event description from Eventlog system, but
when I try to the API to load the dll, it fails.
For example, here is what my code does:
1. strcpy(szKey, "SYSTEM\\CurrentControlSet\\"Services\\EventLog\\Security\\");
2. RegOpenKey(HKEY_LOCAL_MACHINE, szKey, &hKey)
3. RegQueryValueEx(hKey, _T("EventMessageFile"), 0, &dwType,
4.ExpandEnvironmentStrings (szPath, szPathFile, _MAX_PATH + 1)
5. hm = LoadLibraryEx(szPathFile, 0, DONT_RESOLVE_DLL_REFERENCES);
Lines 1-4 run fine, but when I check the return value from line 2, it
shows that it's zero. However, when I change this code to look for
events under "Application", it works fine.
Any idea what I could be wrong or what I am missing to do? Any help
will be highly appreciated.