Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

How to tell if IE has gone out to lunch?

by chinman (Monk)
on Dec 09, 2001 at 22:35 UTC ( [id://130541]=perlquestion: print w/replies, xml ) Need Help??

chinman has asked for the wisdom of the Perl Monks concerning the following question:

Greetings,

I have a little subroutine that refreshes a IE browser window as shown below. Sometimes I find that internet explorer is out to lunch and this sub hangs my program. Is there anyway to trap this error and give up for example, e.g., by using eval or something.

Thanks,
chinman

##subroutine that displays a file in IE browser window ##only works if a browser is running sub display_browser { my $file = shift; ## convert backslashes to forward slashes in the file path $file =~ s!\\!/!g; if ( $^O eq "MSWin32" and "$file" and -e "$file" ) { use Win32::OLE; ## test to see if internet explorer is already running my $ie = Win32::OLE->GetActiveObject("InternetExplorer.Applica +tion"); if ( defined $ie ) { $ie->{Visible} = 1; $ie->Navigate("$file"); } } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://130541]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-20 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found