Is there anything else you must do in order
forWin32::EventLog::Message::RegisterSource to take effect?  I downloaded
it from Dave Roth's site using PPM, and tested it with the following
script:

use strict;
use Win32::EventLog;
use Win32::EventLog::Message;

sub WriteToEventLog
{
    my ($eventType, $text) = @_;
    my $DisplayName = "Fred";
    Win32::EventLog::Message::RegisterSource( "Application", $DisplayName )
|| die "error: $!\n";
    my $Event = Win32::EventLog->new( $DisplayName ) || die;
    my $Result = $Event->Report(
        {
            EventID     => 0,
            Strings     => $text,
            EventType   => $eventType,
        }
    );
    $Event->Close();
}

WriteToEventLog(EVENTLOG_ERROR_TYPE, "Hello");

Unfortunately, the event detail still came out as "The description for
Event ID (0) in Source (Fred) could not be found.  It contains the
following insertion strings: Hello."

I was led to believe that RegisterSource fixed this.  Any suggestions as to
what I am doing wrong, or extra things I need to do with the PPM install?

Thanks in advance,

Phil Morley.


                                                                                       
     
                    Dave Roth                                                          
     
                    <[EMAIL PROTECTED]        To:     'Philip Morley'                       
     
                    et>                  <[EMAIL PROTECTED]>                   
     
                                         cc:     
[EMAIL PROTECTED], 
                    18/04/02             
[EMAIL PROTECTED]    
                    16:21                Subject:     RE: EventLog Question            
     
                                                                                       
     
                                                                                       
     



You can get Win32::EventLog::Message using PPM:

Ppm install http://www.roth.net/perl/packages/win32-eventlog-message.ppd

-----Original Message-----
From: Philip Morley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 6:45 AM
Cc: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: EventLog Question



Where the suggestions posted by the other correspondents of any use?  I'm
afraid I have no other suggestions.  The code I posted in response to your
previous mail did display the error icon on my NT machine, it's weird that
it didn't on yours.  Can you just confirm when/where you got the
Win32::EventLog installation from, please?  Also my installation
(ActiveState Perl 5.6.1) doesn't recognise
Win32::EventLog::Message::RegisterSource.  Any idea why?

Thanks,

Phil Morley





                    rAuL

                    <luar@speakea        To:     rAuL <[EMAIL PROTECTED]>

                    sy.net>              cc:     "Philip Morley"

                                         <[EMAIL PROTECTED]>, rAuL

                    17/04/02             <[EMAIL PROTECTED]>,

                    14:34
[EMAIL PROTECTED],

[EMAIL PROTECTED]
                                         Subject:     Re: EventLog Question






I'm sorry to report that this did not work.  I still do not see the icon
change.  I am using the latest Active State distribution and using their
VPM
tool, I got the latest Win32::Event::Message.

On 16 Apr 2002, rAuL wrote:

>
> Sorry for taking a week to respond to this but
> here is my code:
>
> WriteToEventLog (EVENTLOG_ERROR_TYPE, "An
> error has occurred")
>
> sub WriteToEventLog { my ($eventType,
> $text) = @_;
>
>     Win32::EventLog::Message::RegisterSource(
>     "Application", $DisplayName );
>
>     my $Event = Win32::EventLog->new(
>     $DisplayName ) || die;
>
>     my $Result = $Event->Report( { EventID =>
>     EVENT_ID, Strings => $text, EventType =>
>     $eventType, } );
>
>     $Event->Close(); }
>
>
> Again the problem is that while the error
> message does get written to the event log,
> only the INFORMATION icon is displayed rather
> than the ERROR icon. This happens under NT 4.0
> and 2000.
>
> Thanks
>
> Raul Rodriguez
>
>
> On 12 Apr 2002, Philip Morley wrote:
>
> >
> > No. I see the error or warning icons on my
> > viewer. Perhaps you should include a snippet
> > of the code you use that writes to the Event
> > Log...?
> >
> > Phil Morley
> >
> >
> >
> >
>
> >                     rAuL
> >                     <[EMAIL PROTECTED]>
> >                     Sent by: To:
> >                     perl-win32-a- dmin-admi-
> >                     [EMAIL PROTECTED] <Perl--
> >                     Win32-admin@listser-
> >                     v.ActiveState.com>
> >                       eState.com cc:
> >                       Subject: EventLog
> >                       Question
> >
>
> >                     12/04/02 16:05
> >
>
> >
>
> >
> >
> >
> >
> > Whenever I use EVENTLOG_ERROR_TYPE or
> > EVENTLOG_WARN_TYPE, I do not see a error or
> > warning icon in Event Viewer. Is this
> > normal?
> >
> > ________________________________________-
> > _____-
> > __
> > Perl-Win32-Admin mailing list
> > [EMAIL PROTECTED] To
> > unsubscribe:
> > http://listserv.ActiveState.com/-
> > mailman/mysubs
> >
> >
> >
> >
> >
> > ________________________________________-
> > _____-
> > __
> > Perl-Win32-Admin mailing list
> > [EMAIL PROTECTED] To
> > unsubscribe:
> > http://listserv.ActiveState.com/-
> > mailman/mysubs





_______________________________________________
Perl-Win32-Admin mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs





_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to