Article View: borland.public.cppbuilder.nativeapi
Article #12953Re: ReportEvent api
From: Mike Collins
Date: Sun, 09 Nov 2003 13:44
Date: Sun, 09 Nov 2003 13:44
41 lines
2105 bytes
2105 bytes
Like I said, it's almost exactly the same as your example:
HANDLE hEvntLogHnd = NULL;
try
{
hEvntLogHnd = RegisterEventSource(NULL, "TSystemToolsEventSource");
if (hEvntLogHnd)
{
LPSTR lpMsg = "This is a test Error Message";
if (!ReportEvent(hEvntLogHnd, EVENTLOG_ERROR_TYPE, 0, 0, NULL, 1, 0,
(LPCTSTR*)&lpMsg, NULL))
{
ShowMessage("Error reporting event...");
}
}
else
{
ShowMessage("Error registring even source...");
}
}
__finally
{
if (hEvntLogHnd )
{
DeregisterEventSource(hEvntLogHnd );
}
}
I've tested the code on my dev laptop and I ge nothing, as I mentioned,
theres no entries in my logs at all, for any events - which is a little
strsnge and disconcerting as I have nost actions audited. Run the same code
on another XP text box and the event registers OK. Do understand that
one...
Thanks again,
Mike C
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:3fadc4c3$1@newsgroups.borland.com...
>
Technical Details
Message-ID:
<3fae3ecb$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fac4142@newsgroups.borland.com> <3fac7ee3$1@newsgroups.borland.com> <3fad98bc@newsgroups.borland.com> <3fadc4c3$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,b799f6aac84a0ff5 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-09 05:39:03 PST Reply-To: "Mike Collins" <mikec@kr8.co.uk> From: "Mike Collins" <mikec@kr8.co.uk> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fac4142@newsgroups.borland.com> <3fac7ee3$1@newsgroups.borland.com> <3fad98bc@newsgroups.borland.com> <3fadc4c3$1@newsgroups.borland.com> Subject: Re: ReportEvent api Date: Sun, 9 Nov 2003 13:44:03 -0000 Lines: 43 Organization: kr8 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 81.2.78.34 Message-ID: <3fae3ecb$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1068383947 81.2.78.34 (9 Nov 2003 05:19:07 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail