I believe I forgot that Win32::OLE runs in-process (duh), so a crash of an 
object created (or attempted to be created) will bring down the caller as well.

I agree about the redundancy in messaging for a new method failure, one of 
those things as well (not sure if all of the methods were available 2 years 
ago...).

The top level script opens separate filehandles for STDOUT and STDERR.

I have upped logging (configurable) so that my code turns on the Debug mode in 
the WSFTP SDK.  Every connection is logged to a separate file, but when the 
failure does occur again I will probably find that it is truncated as well due 
to the write buffer not being flushed due to a crash.

I agree about the EOL character, trust me the way the logs are formatted it 
works better this way :)


Thanks,

Nick



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Raven
Sent: Thursday, March 08, 2007 6:21 AM
To: [EMAIL PROTECTED]
Subject: RE: Win32::OLE 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Bharucha, Nikhil
Sent: 08 March 2007 00:18
To: [EMAIL PROTECTED]
Subject: Win32::OLE 

> Hi All,
> 
> I have code that has been in Production for almost 2 years running
many times per day flawlessly.  I am 
> interacting with a 3rd party DLL (WS_FTP Secure Dev Kit) which acts as
a COM server.  About 1.5 months ago and > yesterday the DLL caused my
Perl exe to crash; the crash should have been trapped by eval blocks,
but wasn't...

Which begs the question, what do you mean by crash. An eval block could
be used to trap a die, but not a crash as I understand the term. Also, I
see no eval in the code you provide.

> 
> Here is the sub (OO Method) where I execute the new method:
> 
> # Create a new WSFTP API object #
> 
> sub createWSFTPComObject
> {
>             my $self = shift;
>             my $objRef = Win32::OLE->new('WsftpSDK.WsftpApi') || die
"\nWSFTP.pm - Unable to instantiate WS_FTP > API object, error: $!";

The following if statement is redundant as the statement above already
tests for undef. Also, it is more usual to use the function 'defined'.
Also, consider using Win32::OLE->LastError, which may give more relevant
info than $!.

>             if ($objRef == undef)
>             {
>                         print "\nWSFTP.pm - Unable to create WS_FTP
API Object!";
>                         die "\nWSFTP.pm - $!";

Are you aware that the above two statements direct their output to
different streams (STDOUT and STDERR), which may well end up in
different places?

>             }
>         
>             if ($self->{_displayMode} == 3)
>             {
>                         print "\nWSFTP.pm - Created WS_FTP API Object
" . $objRef;
>             }
>            
>             return $objRef;
> }
> 
> I am using ActivePerl 5.8.4.810 packaged to an exe using PDK 5.3.  The
code is running on a Windows 2003 
> server.  

I suspect that this problem could be a little difficult to track down
unless you can reproduce it with a better frequency that 1.5 months. If
you could create a script that reproduces the problem more reliably it
would help a lot. It may even lead to you discovering the problem for
yourself.

As a small aside, you seem to have your line end character (i.e. "\n")
at the wrong end of your lines ( :-) )

HTH

-- 
Brian Raven 

=========================================
Atos Euronext Market Solutions Disclaimer
=========================================

The information contained in this e-mail is confidential and solely for the 
intended addressee(s). Unauthorised reproduction, disclosure, modification, 
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message do not 
necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England & Wales with 
registration no. 3962327.  Registered office address at 25 Bank Street London 
E14 5NQ United Kingdom. 
Atos Euronext Market Solutions SAS - Registered in France with registration no. 
425 100 294.  Registered office address at 6/8 Boulevard Haussmann 75009 Paris 
France.

L'information contenue dans cet e-mail est confidentielle et uniquement 
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. 
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail 
vous parvient par erreur, nous vous prions de bien vouloir prevenir 
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre 
systeme. Le contenu de ce message electronique ne represente pas necessairement 
la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au 
Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank 
Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré 
au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris 
et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France.
=========================================

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to