Jump to content

Recommended Posts

Posted

Hello,

I was recently messing with the captDLL and am having some problems. Every time I use it I get this error:

Posted Image

I am using V2 from here:

http://www.autoitscript.com/forum/index.ph...t=0&start=0

This is the example I am using. (What was provided)

; Capture full screen
; Fist parameter - filename, last - jpeg quality. 
DllCall("captdll.dll", "int", "CaptureScreen", "str", "dump_full.jpg", "int", 85)
; Capture given region
; Fist parameter - filename, next four: left, top, width, height. Last one - jpeg quality.
; Set quality to any negative number to capture into BMP
DllCall("captdll.dll", "int", "CaptureRegion", "str", "dump_partial.bmp", "int", 100, "int", 100, "int", 300, "int", 200, "int", -1)

Any ideas? :shocked:

Posted

  1905russell said:

Any ideas? :shocked:

Did you open the dll?

$dll = DllOpen("captdll.dll")
DllCall($dll, "int", "CaptureScreen", "str", "dump_full.jpg", "int", 100)

Yes, same error.

Posted (edited)

  lolp1 said:

Yes, same error.

You're using beta and the dll is in the same directory as the calling script?

It works fine here also.

Edited by 1905russell
Posted

You have forgotten to declare the calling convention (with "cdecl"). Later versions of AutoIt require that you do it.

It should look something like this: (Have not tested it myself since I'm to lazy to mess with the required .dll :shocked: )

; Capture full screen
; Fist parameter - filename, last - jpeg quality.
DllCall("captdll.dll", "int:cdecl", "CaptureScreen", "str", "dump_full.jpg", "int", 85)
; Capture given region
; Fist parameter - filename, next four: left, top, width, height. Last one - jpeg quality.
; Set quality to any negative number to capture into BMP
DllCall("captdll.dll", "int:cdecl", "CaptureRegion", "str", "dump_partial.bmp", "int", 100, "int", 100, "int", 300, "int", 200, "int", -1)
Posted (edited)

It should look something like this: (Have not tested it myself since I'm to lazy to mess with the required .dll :shocked: )

I tested it and for me both ("int" or "int:cdecl") work with beta, thanks. Hopefully this solves lolp1's problem.

Correction: I just installed beta v3.2.3.6 (Apr17,07) and "int" gives me the same error as lolp1 but "int:cdecl" works perfectly.

Edited by 1905russell

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...