Loading ...
Sorry, an error occurred while loading the content.

626Re: [perlguitest] Re: DibSect is not working, please help

Expand Messages
  • Nicole Sheldon
    Nov 5, 2004
    • 0 Attachment
      Dennis,

      I get the following error when I run the example
      code below:

      Can't locate object method "new" via package
      "Win32::GuiTest::DibSect" (perhaps you forgot to load
      "Win32::GuiTest::DibSect"?) at
      C:\OCR\Dev\testDibSect.pl line 7.


      Which seems bazaar to me because I have access to
      the rest of the GuiTest functionality. This type of
      error almost always originates from having a missing
      piece of the total package - in this case the piece is
      the DibSect module associated with GuiTest.

      I have tried searching for DibSect on my HD and I
      thought it should be at
      C:\perl\site\lib\win32\GuiTest\DibSect. It isn't. The
      only file I can find is
      C:\perl\site\lib\win32\GuiTest.pm.

      I have even tried different installations of GuiTest
      to no avail.

      Any ideas?

      I do not think the problem is a code problem (syntax
      error, etc.) but is more likely an installation issue.
      I base this conclusion on the below code not working
      even though I executed it verbatim. If it works for
      Dennis I thought it should work for me too :(


      Thanks!


      --- "Dennis K. Paulsen" <ctrondlpaulsden@...>
      wrote:

      >
      >
      > Hello,
      >
      > The following example works for me... Note the case
      > sensitivity
      > of "Win32::GuiTest"...
      >
      >
      > #!/usr/bin/perl -w
      >
      > use Win32::GuiTest qw(:ALL);
      >
      >
      > $ds = new Win32::GuiTest::DibSect;
      >
      >
      > my @windows = FindWindowLike(0, "C",0); #,
      > "^XLMAIN\$");
      > for (@windows) {
      > SetForegroundWindow($_);
      > $ds->CopyWindow($_);
      > $ds->ToGrayScale();
      > $ds->SaveAs("c:\\bla.bmp");
      > $ds->ToClipboard();
      > }
      >
      >
      >
      > Regards,
      > Dennis K. Paulsen
      >
      > --- In perlguitest@yahoogroups.com, "snikki326"
      > <snikki326@y...>
      > wrote:
      > >
      > >
      > > Hello,
      > >
      > > I get an error when I try to use
      > Win32::GUITest::DibSect
      > >
      > > For example:
      > > -----------------------------
      > > #!/usr/bin/perl -w
      > > use Win32::GUITest;
      > >
      > > $ds = new Win32::GUITest::DibSect;
      > >
      > > my @windows = FindWindowLike(0, "MY WINDOW",0); #,
      > "^XLMAIN\$");
      > > for (@windows) {
      > > SetForegroundWindow($_);
      > > $ds->CopyWindow($_);
      > > $ds->ToGrayScale();
      > > $ds->SaveAs("c:\bla.bmp");
      > > $ds->ToClipboard();
      > > }
      > > -----------------------------
      > >
      > > However, the script crashes on:
      > > $ds = new Win32::GUITest::DibSect;
      > >
      > > The error message is:
      > > Can't locate object method "new" via
      > > package "Win32::GUITest::DibSect" (perhaps you
      > forgot to
      > > load "Win32::GUITest::DibSect"?) at testDibSect.pl
      > line 5.
      > >
      > > Which is a very elementary error. It means that
      > DibSect is not
      > > there.
      > >
      > > Can anyone suggest any way of getting DibSect to
      > work? The only
      > > reference I can find is
      > http://search.cpan.org/~ctrondlp/Win32-
      > > GuiTest-1.50.2-ad/guitest.pm
      > >
      > >
      > > And that is very sparse at best.
      > >
      > > Anyone know how to get documentation on DibSect?
      > >
      > > Thanks!
      >
      >
      >
      >
    • Show all 11 messages in this topic