Re: Непонятки

From
Andrey Kochin (2:5026/23.45)
To
dvorkin@math.omsu.omskreg.ru ()
Date
2001-09-18T21:16:15Z
Area
SU.WINDOWS.NT.PROG
Пpивет, dvorkin@math.omsu.omskreg.ru !

Суббота Сентябpь 15 2001, dvorkin@math.omsu.omskreg.ru пишет к Vladlen V.
Beskrownu:

 >> void main()
 >> { HANDLE handle;
 >>   LPCTSTR strings;
 >>   handle = OpenEventLog(NIL, "xxxxxx");
 >>   strings = "My Cool String";
 >>   ReportEvent(handle,4,0,0,0,1,NULL,&strings,NULL);


 d>    ReportEvent(handle,4,0,0,0,1,NULL,strings,NULL);
Нет.

LPCTSTR *lpStrings,
 // array of strings to merge with message

Points to a buffer containing an array of null-terminated strings that are
merged into the message before Event Viewer displays the string to the user.
This parameter must be a valid pointer (or NULL), even if wNumStrings is zero.

Ответ искать тут:

Event Logging Management Information
...

When an application uses the RegisterEventSource or OpenEventLog function to
get a handle of an event log, the event logging service searches for the
specified source name in the registry. For example, the Application logfile
might have configured sources of MicrosoftR SQL ServerT and MicrosoftR Excel. If
an application uses RegisterEventSource or OpenEventLog with a source name of
Application, SQL, or Excel, the event logging service returns a handle to the
Application logfile.

An application can use the Application event log without adding a new source
key to the registry. If the application calls RegisterEventSource, passing a
source name that cannot be found in the registry, the event logging service uses
the Application logfile by default. However, because there is not a message or
category string file, the event viewer will not be able to map the event
identifier or category to a replacement string. For this reason, the recommended
procedure is to add a unique source name for the application to the registry.
This allows you to specify message files for the event identifier and category
in your events. Applications and services should add their source names to the
Application logfile. Device drivers should add their source name to the System
logfile.
...

ЗЫ. Кажется, я отвечаю не тому, кто спрашивал... :)


Пока!
Andrey

---
 * Origin:  Бытие обременяет сознание.  (FidoNet 2:5026/23.45)