in reply to wxHtmlWindow causes exe to crash after PAR::PACKER

Details please. What's your packing routine look like?

++$anecdote ne $data


Replies are listed 'Best First'.
Re^2: wxHtmlWindow causes exe to crash after PAR::PACKER
by wongie (Novice) on Dec 01, 2014 at 13:28 UTC

    I created a special Perl module to demonstrate this problem. If you comment out "use wxHtmlWindow" then the PAR::PACKER works otherwise no.

    #!c:/perl/bin/perl use strict; use warnings; package MyApp; use strict; use warnings; use base 'Wx::App'; sub OnInit { my $frame = MyFrame->new; $frame->Show(1); return 1; } package MyFrame; use Wx qw(:everything); use base 'Wx::Frame'; use wxHtmlWindow; ############ the culprit sub new { my ($class) = @_; my $self = $class->SUPER::new( undef, -1, 'TextEntryDialog.pl', wxDefaultPosition, wxDefaultSize, ); my $statusBar = Wx::StatusBar->new($self, wxID_ANY, wxST_SIZEGRIP) +; $self->SetStatusBar($statusBar); my @widths = (250, 100, -1); $statusBar->SetFieldsCount($#widths+1); $statusBar->SetStatusWidths(@widths); $statusBar->SetStatusText("Ready", 0); myStdDialogs($self); return $self; } sub myStdDialogs { my ( $self ) = @_; my $getTextFromUser = Wx::GetTextFromUser( "This is some text, actually a lot of text\nEven two +rows of text", "Enter a String: ", wxOK | wxCANCEL, $self); # Wx::MessageBox("$getTextFromUser", "Entered String", wxOK | wxICON +_INFORMATION, $self); } # package main; # # MyApp->new->MainLoop; or my $app = MyApp->new; $app->MainLoop;

    I use the following command to create the executable:

    pp -v 3 -g -l C:\Perl\site\lib\Alien\wxWidgets\msw_2_8_12_uni_gcc_3_4\lib\libgcc_s_sjlj-1.dll -l C:\Perl\site\lib\Alien\wxWidgets\msw_2_8_12_uni_gcc_3_4\lib\libstdc++-6.dll -l C:\Perl\site\lib\Alien\wxWidgets\msw_2_8_12_uni_gcc_3_4\lib\wxbase28u_gcc_wxPerl.dll -l C:\Perl\site\lib\Alien\wxWidgets\msw_2_8_12_uni_gcc_3_4\lib\wxmsw28u_adv_gcc_wxPerl.dll -l C:\Perl\site\lib\Alien\wxWidgets\msw_2_8_12_uni_gcc_3_4\lib\wxmsw28u_core_gcc_wxPerl.dll -o test.exe -r TextEntryDialog.pl -L test.log

      If you comment out "use wxHtmlWindow" then the PAR::PACKER works otherwise no.

      So what?

      There is no perl module called wxHtmlWindow, did you create one?

        Sorry, I forget to mention that I use wxPerl as shown in the code. In my code snippet, I have not included the module that uses the wxHtmlWindow to make the code simpler.

        The PAR::PACKER problem seems to do with the "use wxHtmlWindow" regardless of whether I include the actual module or not.

        Here is the code for wxHtmlWindow:

        use Wx::Html; package wxHtmlWindow; use strict; use base qw(Wx::Panel); use Wx qw(:sizer); use Wx::Event qw)EVT_BUTTON); sub new { my $class = shift; my $this = $class->SUPER::new( $_[0], -1 ); my $html = $this->{HTML} = wxHtmlWindow::Derived->new( $this, -1 ); my $top_sizer = Wx::BoxSizer->new( wxVERTICAL ); my $but_sizer = Wx::BoxSizer->new( wxHORIZONTAL ); my $print = Wx::Button->new( $this, -1, 'Print' ); my $forward = Wx::Button->new( $this, -1, 'Forward' ); my $back = Wx::Button->new( $this, -1, 'Back' ); my $preview = Wx::Button->new( $this, -1, 'View' ); #my $pages = Wx::Button->new( $this, -1, 'Page Setup' ); $but_sizer->Add( $back ); $but_sizer->Add( $forward ); $but_sizer->Add( $preview ); $but_sizer->Add( $print ); #$but_sizer->Add( $pages ); $top_sizer->Add( $html, 1, wxGROW|wxALL, 5 ); $top_sizer->Add( $but_sizer, 0, wxALL, 5 ); $this->SetSizer( $top_sizer ); $this->SetAutoLayout( 1 ); EVT_BUTTON( $this, $print, \&OnPrint ); EVT_BUTTON( $this, $preview, \&OnPreview ); EVT_BUTTON( $this, $forward, \&OnForward ); EVT_BUTTON( $this, $back, \&OnBack ); #EVT_BUTTON( $this, $pages, \&OnPageSetup ); $this->{PRINTER} = Wx::HtmlEasyPrinting->new( 'ZTC GUI' ); return $this; } sub html { $_[0]->{HTML} } sub printer { $_[0]->{PRINTER} } sub OnPrint { my( $this, $event ) = @_; $this->printer->PrintFile( $this->html->GetOpenedPage ); } #sub OnPageSetup { # my $this = shift; # # $this->printer->PageSetup(); #} sub OnPrinterSetup { my $this = shift; $this->printer->PrinterSetup(); } sub OnPreview { my( $this, $event ) = @_; $this->printer->PreviewFile( $this->html->GetOpenedPage ); } sub OnForward { my( $this, $event ) = @_; $this->html->HistoryForward(); } sub OnBack { my( $this, $event ) = @_; $this->html->HistoryBack(); } package wxHtmlWindow::Derived; use strict; use base qw(Wx::HtmlWindow); sub new { my $class = shift; my $this = $class->SUPER::new( @_ ); $this->LoadPage( 'files/index.html' ); # in /files folder #print $this->ToText, "\n"; return $this; } sub OnLinkClicked { my( $this, $link ) = @_; Wx::LogMessage( 'Link clicked: href="%s"', $link->GetHref() ); $this->SUPER::OnLinkClicked( $link ); } 1;

        I think I have created some confusion here. It might be clearer if I change the title to Wx::Html causes exe to crash after PAR::PACKER.

        Basically replace everything to do with wxHtmlWindow by Wx::Html in my previous appends and the problem remains the same.

        Sorry about the confusion. My fault.