Sign in to follow this  
Followers 0
lolp1

Capt DLL problem.

7 posts in this topic

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:

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

Any ideas? :shocked:

Edited by 1905russell

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

#7 ·  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

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