Click here to get back home

Pointers for AxWindow

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Pointers for AxWindow Ash 08-23-2007
Posted by Ash on August 23, 2007, 4:40 pm
Please log in for more thread options


Hi!

I'm using AxWindow to display MS-Word document on the Shell.Explorer.
But once the AxWindow loads MS-Word file, Windows' error message pops
up and the program terminates automatically. The pop up says that
there was "Perl command line interpreter error". It only happens with
Word files and not with Excel sheet.

Is this bug in the module or am I doing something wrong. Your answer
would save me a lot of time, thank you.

Sincerely,
Ashish Rai.


Below is the code:

use Win32::GUI();
use Win32::GUI::AxWindow;
my $Class = 'Shell.Explorer.2';
my $file = "C:/temp/RS.doc"; # This is exactly the same code as
shown in samples in cpan.org except I'm loading ms-office document.
#my $file = "C:/temp/RS.doc";

# Main Window
$Window = new Win32::GUI::Window(
-name => "Window",
-title => "Win32::GUI::AxWindow test",
-pos => [100, 100],
-size => [400, 400],
);

#Add a web browser ActiveX
$Control = new Win32::GUI::AxWindow (
-parent => $Window,
-name => "Control",
-control => $Class,
-pos => [0, 0],
-size => [400, 400],
);


#Register some event
$Control->RegisterEvent("StatusTextChange",
sub {
$self = shift;
$eventid = shift;
print "Event : ", @_, "\n";
} );

# Call Method
$Control->CallMethod("Navigate",$file);

# Event loop
$Window->Show();
Win32::GUI::Dialog();

# Main window event handler

sub Window_Resize {
if (defined $Window) {
($width, $height) = ($Window->GetClientRect)[2..3];
$Control->Move (0, 0);
$Control->Resize ($width, $height);
}
}

sub Win_Terminate
{
$Control->Release();
return -1;
}


Similar ThreadsPosted
Problem with Win32::API and pointers May 12, 2006, 10:02 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap