Sign in to follow this  
Followers 0
Myicq

Win7/64 bit and DllCall

2 posts in this topic

#1 ·  Posted (edited)

I am trying to include a simple zip (or 7-zip) function into a script, but I seem to struggle with DllCall

I have Win7 / 64bit, and use latest Dec'11 version of AutoIT.

The problem is that any line using DllCall fails, seems like the return is not an array.

Local $aRet = DllCall($dHnd, "int", "SevenZip", _
            "hwnd", $hWnd, _
            "str", "a " & $sArcName & " " & $sFileName & " " & $iSwitch, _
            "ptr", DllStructGetPtr($tOutBuffer), _
            "int", DllStructGetSize($tOutBuffer))
; it will fail here...
; saying $aRet is not an array
If Not $aRet[0] Then Return SetError(0, 0, DllStructGetData($tOutBuffer, 1))

I have directly copied all the sample code. Tested paths. Tried using both 7-zip32.dll and 7zip.dll (64bit), made sure that dlls were in @scriptdir. No luck.

Did I miss something or is there a problem using DllCall under AutoIT3 / Win7 64bit ?

I did set autoit64bit.exe to "always run as administrator", to avoid UAC issues.

In a virtual WinXP box, I could make the 7zip script work, so suspect it's something on my Win7 box.

Any help appreciated.

**EDIT**

Installed AutoIT3 again, this time selecting "use 32bit version (recommended for compatability)". And it worked.

My skills are not enough to say if this is a "feature" or a "bug" - will leave that to the wise ones and only conclude for myself that there is a difference (for me) with DllCall()

Edited by Myicq

I am just a hobby programmer, and nothing great to publish right now.

Share this post


Link to post
Share on other sites



The problem is that any line using DllCall fails, seems like the return is not an array.

Read the Remarks section for DllCall() in the helpfile. An array is only returned on success, you need to check @error for failures.

Installed AutoIT3 again, this time selecting "use 32bit version (recommended for compatability)". And it worked.

You must have used a x86 dll. You can use #AutoIt3Wrapper_UseX64=y/n (or set the checkbox in the Compile-dialog) to set what arch to use. This requires SciTE4AutoIt3.

The option set at the installer will be what runs if you don't supply the #AutoIt3Wrapper_UseX64 directive.

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  
Followers 0