Event Log

A

Anis

hi,
i want to know what is event that windows log in "Event Log".
i have read that there r some services that log the event, but at the
base level what exactly event is ?

and can we make our own events and can supply that to those services?
 
M

Malcolm

Anis said:
hi,
i want to know what is event that windows log in "Event Log".
i have read that there r some services that log the event, but at the
base level what exactly event is ?

and can we make our own events and can supply that to those services?
Windows works by sending "messages" to windows.
If we are writing our program in C, we instantly have a problem. C only
allows us to call functions, not to receive messages.

The workaround is to pass a pointer to a message processing function to the
Windows system. Windows then calls this function from its internals. That is
one example of why function pointers can be useful.

Now there will be ways to getting Windows to log the calls it makes to the
message processing functions, and there will be ways of getting Windows to
generate such calls. However that takes us too far from the C language
issues of your question and into the details of the Windows implementation,
which is not topical here. However comp.os.windows.programmer will probably
be only too happy to help.
 
S

Skarmander

Malcolm said:
Windows works by sending "messages" to windows.
If we are writing our program in C, we instantly have a problem. C only
allows us to call functions, not to receive messages.

The workaround is to pass a pointer to a message processing function to the
Windows system. Windows then calls this function from its internals. That is
one example of why function pointers can be useful.
Off-topic as this is, what on earth are you babbling about? Windows
implements message queues, and requires you to implement a callback function
for processing these message queues. This is not a "workaround", it's the
way things are implemented. It's a workaround only insofar as messages do
not magically appear somewhere.
Now there will be ways to getting Windows to log the calls it makes to the
message processing functions, and there will be ways of getting Windows to
generate such calls.

Which is not at all what OP's asking. The "event" is just a packet of data
with some structure in it. You add them to the event log by calling
ReportEvent() on an event log you opened with OpenEventLog(). You do not
even need to create windows for this, and services usually do not.

My advice to the OP is to forget everything they've read so far.
However that takes us too far from the C language issues of your question
and into the details of the Windows implementation, which is not topical
here. However comp.os.windows.programmer will probably be only too happy
to help.
Yes. Directing people to the correct newsgroup without further ado is the
best course of action. You should usually leave it at that, lest you lose
the benefit of such redirecting (reduced OT traffic).

S.
 
S

Skarmander

Malcolm said:
Windows works by sending "messages" to windows.
If we are writing our program in C, we instantly have a problem. C only
allows us to call functions, not to receive messages.

The workaround is to pass a pointer to a message processing function to the
Windows system. Windows then calls this function from its internals. That is
one example of why function pointers can be useful.

Now there will be ways to getting Windows to log the calls it makes to the
message processing functions, and there will be ways of getting Windows to
generate such calls. However that takes us too far from the C language
issues of your question and into the details of the Windows implementation,
which is not topical here. However comp.os.windows.programmer will probably
be only too happy to help.
Incidentally, it's comp.os.ms-windows.programmer, and you'll probably want
comp.os.ms-windows.programmer.win32 to be specific.

Alternatively, look it up in the MSDN: http://msdn.microsoft.com and search
for "event log".

S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top