PerlNET 7.2.0 build 284799 compile error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have Microsoft .NET Framework 2.0 Redistributable Package (x86).exe
and Microsoft .NET Framework 2.0 Software Development Kit (SDK) (x86)
- setup.exe both installed.

I'm now testing Activatestate PDK 7 and tried to compile winform
example but got this error:

   PerlNET 7.2.0 build 284799
   Copyright (C) 1998-2008 ActiveState Software Inc. All rights
   Commercial license for ibm
   System.ApplicationException: Can't locate type TextBox
   at PerlRuntime.Interpreter.GetType(Int32 x, String klass)
   at PerlRuntime.Interpreter.typeof(Int32 x, Int32 klass_, Int32& e,
Int32& rt)

I really need help me on this because I am now testing Perl.NET. Below
is the code I got from the User's Guide:

package HelloWorldForm;
use strict;
use PerlNET qw(with AUTOCALL);

use namespace "System";
use namespace "System.Windows.Forms";
use namespace "System.Drawing";

=for interface
[extends: Form]
static void Main();
private field TextBox textBox1;
private void button1_Click(any sender, EventArgs evArgs);

sub Main {
my $self = HelloWorldForm->new;

sub HelloWorldForm {
my $this = shift;

with(my $textBox1 = TextBox->new(),
Text => "Hello Windows Forms World",
Location => Point->new(16, 24),
Size => Size->new(360, 20),
TabIndex => 1);

with(my $button1 = Button->new(),
Text => "Click Me!",
Location => Point->new(256, 64),
Size => Size->new(120, 40),
TabIndex => 2);

$button1->add_Click(EventHandler->new($this, "button1_Click"));

my $height = SystemInformation->CaptionHeight;
Text => "Hello Windows Forms World",
AutoScaleBaseSize => Size->new(5, 13),
ClientSize => Size->new(392, 117),
MinimumSize => Size->new(392, int(117 + $height)),
AcceptButton => $button1,
textBox1 => $textBox1);

$this->->Add($_) for $textBox1, $button1;

sub button1_Click {
my($this, $sender, $evargs) = @_;
MessageBox->Show("Text is: '$this->->'");

Re: PerlNET 7.2.0 build 284799 compile error

Here's a shorter example:


use namespace "System";
#use namespace "System.Windows.Forms";

use PerlNET qw(AUTOCALL);

Console->WriteLine("Hello from Perl!");
System::Windows::Forms::MessageBox->Show("Hello World!\n(Part II)");

Compiled OK but got this at run-time:

Hello from Perl!
System.ApplicationException: Can't locate type
   at PerlRuntime.Interpreter.GetType(Int32 x, String klass)
   at PerlRuntime.Interpreter.call_static(Int32 x, Int32 klass_, Int32
method_, Int32 args_, Int32& e, Int32& rt)

Please help!

Re: PerlNET 7.2.0 build 284799 compile error

Found the solution here:

Site Timeline