Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello:perl.exe - Application error (code and error included)

Status
Not open for further replies.

tchatzi

Technical User
Dec 15, 2004
744
GR

The following code

use strict;
use Win32::GUI;

my $window = Win32::GUI::Window->new (
-width => 200,
-height => 200,
-text => "Hello",
-name => "window1",
);
my $font = Win32::GUI::Font->new (
-size => 20,
-name => "Comic Sans MS",
);
my $lable = $window->AddLabel(
-text => "Hello",
-font => $font,
-foreground => [0, 0, 255],
);


$window->Show ();

Win32::GUI::Dialog();

sub window1_Terminate {
return -1;
}




produce the following error

c:\perlcode\hello.pl



Hello:perl.exe - Application error

The instruction at "0x77c4213b" referenced memory at "0x00000000". The memory could not be "read".

Click on OK to terminate the program
Click on CANCEL to bebug the program

Could someone knows where the mistake could be?

i just made a format and install perl and the appropriate modules with ppm.

Does this has to do with the module Win::Gui or could be a hardware problem?
 
This looks like a bug in the Win32::GUI libraries, which are installed with the module. I have tried both your script and the example used in the Win32::GUI documentation, and although I don't get the same error as you, there are errors. It could be as simple as the compilation of the libraries was done on a machine and a compiler that both you and I don't have. Windows is very unforgiving in this nature.

I have just checked RT and found this ticket (1), which appears to be the same problem as you're having. Try adding a name to your label. Having also check the cpan-testers (2), the native code doesn't compile well at all.

(1) [URL unfurl="true"]http://rt.cpan.org/NoAuth/Bug.html?id=4692[/url]
(2) [URL unfurl="true"]http://www.nntp.perl.org/group/perl.cpan.testers/168760[/url]

Barbie
Leader of Birmingham Perl Mongers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top