Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

How to tell if IE has gone out to lunch?

by chinman (Monk)
on Dec 09, 2001 at 22:35 UTC ( #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? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2022-08-15 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?