Hi Ariel,
As a guess this could be a scoping issue. When your app is shutting down,
various Perl variables will be destroyed and where appropriate, they will
call the destructors "elsewhere" (in the xs code), i.e., your main window
might be getting destroyed before your control (or vice versa) resulting in
crashes. If this is a scoping issue, then it should be easily solvable...
BTW - I ran your code on my box here (perl 5.6 and ax 0.7 I added
$Window->Show();Win32::GUI::Dialog(); to your example) and it didn't crash
on exit - although I've no idea what the control should be:)
Have a play with undef'ing the window and controls in various orders and see
if that makes any difference.
Cheers,
jez.
----- Original Message -----
From: "Ariel Serbin" <[EMAIL PROTECTED]>
To: <perl-win32-gui-users@lists.sourceforge.net>
Sent: Saturday, May 07, 2005 6:02 PM
Subject: [perl-win32-gui-users] AxWindow Application Error
I'm having a problem with AxWindow throwing an error
when it quits. I'm embedding the Microsoft Office
Document Imaging program into my app. When my program
exits, i get a dialog box that reads:
------
The instruction at "xxxxxx" referenced memory at
"xxxxxx". The memory could not be "read". Click OK
to terminate the program
------
Does anyone know how to track down why/where this
error is occurring?
The MODI control seems to be initialized properly and
working fine while the program is running. Please
note that I am calling $Control->Release() as
mentioned in the AxWindow docs.
Here is a stripped down version of my code. Please
note that MODI will only embed with Office 2003 or
later...
(using perl 5.8, ax 0.07, win xp)
use Win32::GUI;
use Win32::GUI::AxWindow;
use Win32::OLE;
use Win32::OLE::Const;
# main Window
$Window = new Win32::GUI::Window (
-title => "Win32::GUI::AxWindow test",
-pos => [100, 100],
-size => [400, 400],
-name => "Window",
) or die "new Window";
# Create AxWindow
$Control = new Win32::GUI::AxWindow (
-parent => $Window,
-name => "Control",
-pos => [10, 10],
-size => [300, 300],
-control => 'MiDocViewer.MiDocView',
) or die "new Control";
sub Window_Terminate {
$Control->Release();
return -1;
}
If anyone knows where I should look to resolve this, I
would be extremely grateful. Once I get this working,
I will submit some examples (and possibly a module)
showing how to play with MODI.
Thanks,
-Ariel
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users