Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Win32::OLE and IE automation

by puff (Beadle)
on Jan 06, 2006 at 16:45 UTC ( #521529=perlquestion: print w/ replies, xml ) Need Help??
puff has asked for the wisdom of the Perl Monks concerning the following question:

Im working on an application that automates IE and needs to handle IEs NewWindow2 event. The IE documentation for the event gives the following stytax:
Private Sub object_NewWindow2( _ ByRef ppDisp As Object, _ ByRef Cancel As Boolean)
When handling the event my perl code is entered with:
sub ie_events(){ my( $ie, $event, @args ) = @_;
In my handler I create a new IE object with:
my $ie = Win32::OLE->new( 'InternetExplorer.Application' ); Win32::OLE->WithEvents($ie, \&ie_events, 'DWebBrowserEvents2' );
Now my question. What is the proper way to set @args to return?

The code
$args[0]->Put( $ie ); $args[1]->Put( 0 );
Eventually leads to crashes. Given that the return should be a ppDisp what should I do?

Comment on Win32::OLE and IE automation
Select or Download Code
Re: Win32::OLE and IE automation
by johnnywang (Priest) on Jan 06, 2006 at 18:30 UTC
    You may want to look at the source of Win32::IE::Mechanize which does IE automation, it may contain some clues.
      Thanks for the clue. I'm actually trying to upgrade IE::Mechanize in this very area. As things now stand, it does not address NewWindow2/3 events. I've got the code that blocks NewWindow working OK, and am in the process of trying to add support for child windows.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (16)
As of 2014-09-02 14:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (24 votes), past polls