Win32::OLE, InternetExplorer, NewWindow, Events --- crashes

P

puff

I'm working on an application that automates IE and needs to handle
IE's 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 is the proper way to return $ie?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top