Jump to content

Error : "subscript used on non-accessible variable" when use _ImageSearch


Recommended Posts

 

Hi everybody , this is my code

 

#include <MsgBoxConstants.au3>
#include <String.au3>
#include <Array.au3>
#include <Excel.au3>
#include <FileConstants.au3>
#include <GUIConstantsEx.au3>
#include <File.au3>
#include <IE.au3>
#include <Inet.au3>
#include <FTPEx.au3>
#include <Misc.au3>
#include <StringConstants.au3>
#include <Date.au3>
#include <ImageSearch.au3>
#include <WinAPIProc.au3>
#include <Constants.au3>

#RequireAdmin
   While 1
      $x_IMG1 = 0
      $y_IMG1 = 0
      $x_IMG2 = 0
      $y_IMG2 = 0

      Local $search1 = _ImageSearch('LGL-Logo.png', 0, $x_IMG1, $y_IMG1, 0)

      if($search1 = 1) then
         MsgBox($MB_SYSTEMMODAL, 'ERROR - 34', "ERROR - 34"&"_")
         ExitLoop
      EndIf

   WEnd

 

This code is still work if I use SciTE.exe to run .

And when I use Aut2exe_x64.exe to Destination (.Exe) file, this code dont work and we have error "subscript used on non-accessible variable".

How to fix this ? 

 

 

 

 

AutoIT-Error.png

ImageSearch.au3

Edited by kctvt
update code
Link to post
Share on other sites

Error line

image.png.bcffcc427e005f4a3486ebc47a3c0f30.png

You can debug from that line but in my head question is can included au3 file call his dll as x64 compiled...

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to post
Share on other sites
  • 1 month later...

Just to clarify:

If your external DLL (which is called by DllCall) is 32bit then your script must be compiled as 32bit too.

Alternatively:

If your external DLL (which is called by DllCall) is 64bit then your script must be compiled as 64bit too.

 

See here for details and syntax for explicit 32/64bit compile directives...

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...