By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

Event Log

P: n/a
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?

Jul 2 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Anis" <an**********@gmail.comwrote
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.

--
Buy my book 12 Common Atheist Arguments (refuted)
$1.25 download or $7.20 paper, available www.lulu.com/bgy1mm
Jul 2 '06 #2

P: n/a
Malcolm wrote:
"Anis" <an**********@gmail.comwrote
>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.
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.
Jul 2 '06 #3

P: n/a
Malcolm wrote:
"Anis" <an**********@gmail.comwrote
>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.
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.
Jul 2 '06 #4

P: n/a
thx ..
thx for the reply

Jul 3 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.