Jez,

Thanks for the reply.  I tried undefing the window,
ax-control and ole-control in various orders.  All of
them still generated the error.  I tried stepping
through the script to see which undef was causing the
error, but it seems to be caused by something under
the hood that happens after all of that.

This error occurs on both my home computer and my work
computer, which are basically the same configuration.

FYI, this control will let you view/ocr/search .tif
and .mdi files.  It just didn't do anything because
we're not asking it to.  If you'd like to see it in
action, add this after the control is set up:

$v = $Control->GetOLE();
$v->{FileName} =  'test.TIF';

there's a decent description of the object model here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mspauto/html/welcomemodi_hv01135783.asp

-ariel

--- Jez White <[EMAIL PROTECTED]> wrote:
> 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
> 
> 
> 

Reply via email to