/* Set the name of DLL full path name. */ if (!GetModuleFileName((HMODULE) g_module, buffer, sizeof(buffer)))
{
MessageBox(NULL, "Could not retrieve DLL filename", "PostgreSQL error", MB_OK | MB_ICONSTOP); return SELFREG_E_TYPELIB;
}
/* *AddPostgreSQLsourcenameasasubkeyundertheApplicationkeyinthe *EventLogregistrykey.
*/
_snprintf(key_name, sizeof(key_name), "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\%s",
event_source); if (RegCreateKey(HKEY_LOCAL_MACHINE, key_name, &key))
{
MessageBox(NULL, "Could not create the registry key.", "PostgreSQL error", MB_OK | MB_ICONSTOP); return SELFREG_E_TYPELIB;
}
/* Add the name to the EventMessageFile subkey. */ if (RegSetValueEx(key, "EventMessageFile", 0,
REG_EXPAND_SZ,
(LPBYTE) buffer,
strlen(buffer) + 1))
{
MessageBox(NULL, "Could not set the event message file.", "PostgreSQL error", MB_OK | MB_ICONSTOP); return SELFREG_E_TYPELIB;
}
/* Set the supported event types in the TypesSupported subkey. */
data = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
if (RegSetValueEx(key, "TypesSupported", 0,
REG_DWORD,
(LPBYTE) &data, sizeof(DWORD)))
{
MessageBox(NULL, "Could not set the supported types.", "PostgreSQL error", MB_OK | MB_ICONSTOP); return SELFREG_E_TYPELIB;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.