Hi Monks!

I'm testing AxWindow module with threads.Creating new thread and posting an html code to AxWindow with OLE object.

But window returning error and after closing.Not find in the script my error.

AxWindow module or Win32::OLE is Thread-safe?

Perl : v5.12

OS : Win7

Win32::GUI : V1.6

Win32::OLE : 0.1709

Here's my test code;
#!perl -w use strict; use warnings; use Win32::GUI qw(WS_CLIPCHILDREN); use Win32::OLE(); use Win32::GUI::AxWindow(); use threads; # main Window my $Window = new Win32::GUI::Window ( -title => "Win32::GUI::AxWindow", -pos => [100, 100], -size => [600, 600], -name => "Window", -addstyle => WS_CLIPCHILDREN, ) or die "new Window"; # A button my $Button = $Window->AddButton ( -name => "Button", -pos => [0, 25], -size => [600, 50], -text => "Click me !!!", ); # Create AxWindow my $Control = new Win32::GUI::AxWindow ( -parent => $Window, -name => "Control", -pos => [0, 100], -size => [600, 500], -control => "Shell.Explorer.2", ) or die "new Control"; # Get Ole object my $OLEControl = $Control->GetOLE(); $OLEControl->Navigate("about:blank"); # Clear control threads->create(\&thrTest); $Window->Show(); Win32::GUI::Dialog(); $Window->Hide(); exit(0); # Running with Button Click event sub Button_Click { my $text = "Click!!"; $OLEControl->{Document}->{body}->insertAdjacentHTML("AfterBegin",$text +); } sub thrTest { my $text = "Thread test on AxWindow"; $OLEControl->{Document}->{body}->insertAdjacentHTML("AfterBegin",$text +); }

Regards,

Ahmet

In reply to Win32::GUI::AxWindow error, with using a thread?! by Ahmet

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.