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

Hi, Im trying to catch a new window in an embedded web browser with WxWidgets.

To do that, I catch the EVT_ACTIVEX_IE_NEWWINDOW2 event, and in that I create a new frame and a browser and return it in ppDisp like this:

sub evt_newwin { $f= Wx::Frame->new( $mainframe, -1, 'New window' ); $b = Wx::ActiveX::IE->new( $f , -1 ); $event = $_[1]; $event->{'ppDisp'}=$b; $f->Show; }

The problem with the above code is that it doesn't work :) The frame shows, there seems to be a browser in it, but then the program simply crashes (no error message).

What am I missing?

BR Sverrir

Replies are listed 'Best First'.
Re: Wx::ActiveX::IE, setting event return in ppDisp crashes
by Anonymous Monk on Nov 09, 2009 at 21:41 UTC
    You're not supposed to use $event as storage, you're only supposed to get information from it
      It works fine writing to it for blocking the popup
      $event->{Cancel}=1;
      but maybe that is some special case?
        That is its intended use, it is a short lived object, and it gets destroyed after the callback is finished.