Jump to content
Sign in to follow this  

OpenCV 64 Bit

Recommended Posts


here is a Autoit3 v3.3.14.5, 64 Bit installation on windows 10 with current updates.

In a simple script I'm Dllcall'ing a 64 bit dll.

# T1.au3
Local $name = "T1DLL.dll"
if (FileExists($name)) Then
    ConsoleWrite("DLL '" &$name &"' exists" &@CRLF)
Local $DLL = DllOpen($name)
if (@ERROR OR $DLL = -1) then
    ConsoleWrite("DllOpen ERROR=" &@ERROR &" DLL=" &$DLL &@CRLF)
    ConsoleWrite("DllOpen Success" &@CRLF)
DllCall($DLL, "none:cdecl", "SomeFunction", "str", "DLL Call from T1.au3")
if (@ERROR) then
    ConsoleWrite("DllCall ERROR=" &@ERROR &" DLL=" &$DLL &@CRLF)
    ConsoleWrite("DllCall Success" &@CRLF)

The C code contains one 64 bit OpenCV call:    cv::destroyAllWindows();.

Excuting T1.au3 with SciTE gives:


>"D:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\T1.au3" /UserParams    
+>21:01:08 Starting AutoIt3Wrapper v.    Environment(Language:0407  Keyboard:00000407  OS:WIN_8/  CPU:X64 OS:X64)
>Running AU3Check (  from:D:\Programme\AutoIt3
+>21:01:08 AU3Check ended.rc:0
>Running:(\Programme\AutoIt3\autoit3_x64.exe "D:\T1.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
DLL 'T1DLL.dll' exists
DllOpen ERROR=0 DLL=-1
DllCall ERROR=1 DLL=-1
+>21:01:08 AutoIT3.exe ended.rc:0
>Exit code: 0    Time: 2.027

If the c code is compiled *without* the OpenCV call T1.au3 runs successful:


>"D:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\T1.au3" /UserParams    
+>21:18:20 Starting AutoIt3Wrapper v.    Environment(Language:0407  Keyboard:00000407  OS:WIN_8/  CPU:X64 OS:X64)
>Running AU3Check (  from:D:\Programme\AutoIt3
+>21:18:20 AU3Check ended.rc:0
>Running:(\Programme\AutoIt3\autoit3_x64.exe "D:\T1.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
DLL 'T1DLL.dll' exists
DllOpen Success
DllCall Success
+>21:18:23 AutoIT3.exe ended.rc:0
>Exit code: 0    Time: 5.051


I checked T1DLL.dll, it's definitely a 64 bit dll.

What could cause the problem?

Any hint would be very much appreciated.







Edited by JoGa
Unintended hit return...

Share this post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MarkIT
      Hi AutoIT Masters,
      Sorry again but Just want to know if you have any idea why the AutoIT scripts converted into 32-bit.exe files are being deleted by AV but not 64-bit.exe. If we raise it to the AV whitelisting, they come back saying it is false positive.
      I disabled AV and everything goes well.
      OS: Windows 10 - 64 bit
      AV: Symantec
      Thanks for the help.

    • By BBs19
      I needed a function to automate programs at work that can't be fully automated via Autoits built in functions.
      For example a virtual machine running on your physical machine, meaning you would need to run an extra script within the virtual machine (if it is even running Windows) in order to automate everything.
      I came across OpenCV which allows matching/finding a picture in another picture. This would also allow searching for a button/text on the screen in order to press the exact position. Fortunately @mylise already translated all the required OpenCV functions to Autoit, I just had to remove all unnecessary functions to make the script as small as possible.
      The problem:
      Using this method, you will never be able to fully automate everything dynamically, as it will only work on the machine with same resolution/dpi settings, same theme etc.. This is only a last resort for programs that can't be automated using the built in Autoit functions.
      Find a given picture on the entire screen (all monitors) or a certain area on the screen and execute mouse clicks on this position. Adjust the threshold so that the picture doesn't have to match 100%. Debugging options like logging and marking the screen where the picture was found etc. Includes a Snapshot-Tool that creates snapshots of a certain area(buttons, text etc.) on the screen and generates the code that is required for the matching. It can also be used to get the coordinates to a marked area on the screen in order to check only on a certain area for the match picture. Example:
      Note: The example will probably not work on your computer, depending on the display resolution and dpi settings, as the picture has to match the exact same size on the screen. Please use the included Snapshot-Tool to generate new match pictures and code very easily.
      #AutoIt3Wrapper_UseX64=n ; In order for the x86 DLLs to work #include "OpenCV-Match_UDF.au3" _OpenCV_Startup();loads opencv DLLs _OpenCV_EnableLogging(True,True,True) ;Logs matches, errors in a log file and autoit console output. ;Please note that these examples might not work as the match pictures have to be found with the exact same size on your screen. ;Example 1 ShellExecute("http://www.tv.com/");Open Website tv.com $Match1 = _MatchPicture(@ScriptDir&"\Match\1.png", 0.70,False,10,500);Try to find the match picture on the screen. Number of tries: 10, Sleep between each try: 500ms. If Not @error Then _MarkMatch($Match1) ;Debugging: Draws a rect on the screen/coordinates of the match to show the user where the match was found Sleep(100) _ClickMouse($Match1, "left",1) ;Calculates the center of the match and clicks the left mouse once on click position EndIf Sleep(1000) ;Example 2, matching on a specific area of the screen ShellExecute("notepad.exe");open nodepad WinWait("[CLASS:Notepad]","",5) WinMove("[CLASS:Notepad]","",0,0,500,500) Local $sCoords[4] = [0, 0, 500,500] $Match2 = _MatchPicture(@ScriptDir&"\Match\2.png", 0.80,$sCoords,3,500) If Not @error Then _MarkMatch($Match2) Sleep(100) _ClickMouse($Match2, "left", 1) EndIf _OpenCV_Shutdown();Closes DLLs So basically, all you need to do is provide a path to the match picture and the function will return you the coordinates (x1,y1,x2,y2) of where the picture has been found on the screen. With these, you can either calculate an exact position for the mouse click or use the "_ClickMouse" function which will execute a mouse click on the center of the coordinates where the picture was found. 
      @mylise for the OpenCV UDF
      Includes the required .DLL files of OpenCV. You can also manually download them on the website of OpenCV (Version 3.x doesn't include these anymore, you need to download 2.x).
    • By Irios
      Searching and searching but I'm unable to find anyone with a proper solution. I see a lot of similar questions on this topic, but nothing that really provides what I'm looking for.
      Basically, I just want to convert a 8 byte hex value to unsigned integer. I.e. "FFFFFFFFFFFFFFFF". I'm working on SNMP opaque data types, and UINT64 values end up as signed INT64 when I use the internal processing of AutoIt. (Yeah, I know, this is because AutoIt always uses signed)
      Example ( I know you guys love example code snippets haha, so here's a two-liner):
      $sUINT64 = "FFFFFFFFFFFFFFFF" ConsoleWrite( Dec($sUINT64) ) -1 is not the result I want, of course.
      And I don't want "1.84467440737096e+019" either by adding manually in AutoIt. I need the decimal value (as a string) of 264 = 18,446,744,073,709,551,616
      Anyone got a clever UDF for this? Or will I have to write one myself, adding and multiplying each hex value, and generating a text string as a result? I know how it can be done, I just hoped someone already had done it so I could steal their code.
    • By paullauze
      i just got a new windows 7 64 bit machine at work. I get a error when complilling with #include <AD.au3>
      excerpt from console:
      xxxAuto ItIncludeAD.au3(423,15) : ERROR: undefined macro.
         If @OSArch =
      xxxAuto ItIncludeAD.au3(423,35) : ERROR: undefined macro.
         If @OSArch = "IA64" Or @OSArch =
      xxxAuto ItIncludeAD.au3(1290,66) : ERROR: _ArrayToString() called with wrong number of args.
           $aAD_Objects[$iCount2][$iCount1 - 1] = _ArrayToString($aTemp)
      C:\Program Files (x86)\AutoIt3\Include\Array.au3(808,87) : REF: definition of _ArrayToString().
      Func _ArrayToString(Const ByRef $avArray, $sDelim, $iStart = Default, $iEnd = Default)
      xxxAuto ItIncludeAD.au3(1306,51) : ERROR: _ArrayToString() called with wrong number of args.
          $aAD_Objects[$iCount2] = _ArrayToString($aTemp)
      even if all i am compiling is th eincludes
      #include <Word.au3>
      #include <Excel.au3>
      #include <AD.au3>
      it has always worked fine XP, so this must have something to do with window 7 or being 64 bit.
    • By ColinRH
      I'm having a problem creating a 64 bit exe using Aut2Exe. I'm running on a Windows 7 64 bit PC and OS.
      If I compile my test script using a right click on the test script I can successfully create a 32 bit or a 64 bit exe. I can easily check this by looking at the properties of the exe, compatibility settings where, for the 64 bit exe compatibility settings "below" Vista are not available whereas, for the 32 bit exe they are.
      If I compile using Aut2Exe (running it from a non-compiled au3 script) then, using the method above, both the 32 bit and 64 bit builds appear to actually be 32 bit exes. The file, MakeTest.au3 is attached.


      If I try to do the same build using the command line input for Aut2Exe I can build the 32 bit version OK but the 64 bit build returns the error "Unable to read in AutoIt stub file. (AutoItSC.bin)". Surely it should be looking for AutItSC_x64.bin if I use the /x64 switch shouldn't it?

      If I try to run Aut2exe_x64 from the command line I get the "not recognised as an internal or external command" message.

      However, double clicking on Aut2exe_x64 and using the UI that's displayed I do get a 64 bit version built.

      I'm very confused - I really need to use a script to compile both 32 and 64 bit versions as the whole thing is part of an automatically built installation "application". Can anyone make sense of it for me or ami I just being stupid?
  • Create New...