Article View: borland.public.cppbuilder.nativeapi
Article #12956Re: ReportEvent api
From: Mike Collins
Date: Mon, 10 Nov 2003 02:11
Date: Mon, 10 Nov 2003 02:11
41 lines
2792 bytes
2792 bytes
No filters, Win2k all patches. Think I may have been wasting your time, tried emptying all the logs and then executed the code again, and it seems to work i.e. entries are written to the log. Must have been some sort of corruption (sounds a bit lame but that's what it appears like). The only problem I'm having now is trying to convert the AnsiString that I'm passing into the function, into a valid parameter that I can pass to ReportEvent. At the moment, I'm hacking it like this: LPSTR lpMsg = szEventMsg.c_str(); if (ReportEvent(hEventLogScr, wEventType, wCategory, dwEventID, NULL, 1, 0, (LPCTSTR*)&lpMsg, NULL)) but I keep getting extra data being written at the end string. Now when I look up the typedef for LPSTR at see a char *, so I don;t really understand what's going on. Not too major though, thought I had a serious problem with my system when no events were registering... Thanks again, sorry for wasting time :-) "Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message news:3faeb8b8$2@newsgroups.borland.com... > > "Mike Collins" <mikec@kr8.co.uk> wrote in message > news:3fae3ecb$1@newsgroups.borland.com... > > > 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... > > Do you have any filtering applied to the first machine's log? What OS is > the first machine using? > > > Gambit > >
Technical Details
Message-ID:
<3faeedf8@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!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> <3fae3ecb$1@newsgroups.borland.com> <3faeb8b8$2@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 18:09:06 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> <3fae3ecb$1@newsgroups.borland.com> <3faeb8b8$2@newsgroups.borland.com> Subject: Re: ReportEvent api Date: Mon, 10 Nov 2003 02:11:31 -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: <3faeedf8@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1068428792 81.2.78.34 (9 Nov 2003 17:46:32 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail