<?xml version="1.0" encoding="windows-1252"?>
<node id="521529" title="Win32::OLE and IE automation" created="2006-01-06 11:45:51" updated="2006-01-06 06:45:51">
<type id="115">
perlquestion</type>
<author id="502839">
puff</author>
<data>
<field name="doctext">
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:&lt;br&gt;
&lt;code&gt;
Private Sub object_NewWindow2( _
	ByRef ppDisp As Object, _
	ByRef Cancel As Boolean) 
&lt;/code&gt;
When handling the event my perl code is entered with:&lt;br&gt;
&lt;code&gt;
sub ie_events(){
    my( $ie, $event, @args ) = @_;
&lt;/code&gt;
In my handler I create a new IE object with:&lt;br&gt;
&lt;code&gt;
my $ie = Win32::OLE-&gt;new( 'InternetExplorer.Application' );
Win32::OLE-&gt;WithEvents($ie, \&amp;ie_events, 'DWebBrowserEvents2' );
&lt;/code&gt;
Now my question.  What is the proper way to set @args to return? &lt;br&gt;
&lt;br&gt;
The code&lt;br&gt;
&lt;code&gt;
        $args[0]-&gt;Put( $ie ); 
        $args[1]-&gt;Put( 0 ); 
&lt;/code&gt;
Eventually leads to crashes.  Given that the return should be a ppDisp what should I do? &lt;br&gt;
&lt;br&gt;
</field>
</data>
</node>
