Sign in to follow this  
Followers 0
Nahuel

Help with Au3lib

12 posts in this topic

I've just downloaded and installed Au3lib. I tried this:

#include <A3LScreenCap.au3>
_ScreenCap_Capture(@DesktopDir &'\Screenshot.jpg')
Exit

and this is what I get when I run it:

Posted Image

what should I do? :)

Share this post


Link to post
Share on other sites



It works here, are you sure you are runnin in Windows XP and AutoIt v.3.2.4.9

Share this post


Link to post
Share on other sites

:) Where does it say I need XP?

Nah, I wave win98...

Share this post


Link to post
Share on other sites

Many stuff in AutoIt doesn't work with Win98, WinNT, i ranyour script it was fine, just double check your Au3Lib and try on XP.

Share this post


Link to post
Share on other sites

Thanks! I'll try it on my other comp. Just one question, if I compile the script on a computer with XP and then run the .exe on this one... would it work?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

i dont understand why this error comes up, are you sure you are testing this code? cause i see in the msgbox ,

Edited by Gif

Share this post


Link to post
Share on other sites

Yeah! There's an error with the include file, apparently. I haven't tried it on XP. Have you?

Share this post


Link to post
Share on other sites

Yeah! There's an error with the include file, apparently. I haven't tried it on XP. Have you?

of course i have, as almost everyone in the forums , if it didnt work PaulIa wouldnt add it to the download section..

but yet if you want to use this code you can, most people have XP or Vista...

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

That return value is in this function in

; #FUNCTION# ====================================================================================================



================
; Description ...: Initialize Microsoft Windows GDI+
; Parameters ....:
; Return values .: Success    - True
;                 Failure     - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Call _GDIP_Startup before you create any GDI+ objects.  GDI+ requires a redistributable for applications  that
;                 run on the Microsoft Windows NT 4.0 SP6, Windows 2000, Windows 98, and Windows Me operating systems.
; Related .......: _GDIP_Shutdown
; ====================================================================================================



===========================
Func _GDIP_Startup()
  Local $pInput, $tInput, $pToken, $tToken, $aResult

  $giA3LGDIPRef += 1
  if $giA3LGDIPRef > 1 then Return True

  $ghA3LGDIPDll = DllOpen("GDIPlus.dll")
  _Lib_Check("_GDIP_Startup (GDIPlus.dll not found)", @Error, -1)

  $tInput = DllStructCreate($tagGDIPSTARTUPINPUT)
  $pInput = DllStructGetPtr($tInput)
  $tToken = DllStructCreate("int Data")
  $pToken = DllStructGetPtr($tToken)
  DllStructSetData($tInput, "Version", 1)
  $aResult = DllCall($ghA3LGDIPDll, "int", "GdiplusStartup", "ptr", $pToken, "ptr", $pInput, "ptr", 0)
  $giA3LGDIPToken = DllStructGetData($tToken, "Data")
  Return $aResult[0] <> 0
EndFunc

I've nerer seen a return value like this "Return $aResult[0] <> 0"

Although it looks like PaulIA uses this return type in several of his UDF's

Edit: Looks like it makes the return value True or False

Edited by ChrisL

Share this post


Link to post
Share on other sites

of course i have, as almost everyone in the forums , if it didnt work PaulIa wouldnt add it to the download section..

but yet if you want to use this code you can, most people have XP or Vista...

No no, that's not what I meant. I meant that there's an error with my computer and Win98, obviously...

Ah that sucks.. I think it's time for a new computer, hehe... this is quite useful.

thanks for your help.

Share this post


Link to post
Share on other sites

I had this same problem on a Windows 2000 system. I discovered that the problem was because the system did not have GDI+. You need to include the DLL in the same directory as your EXE, then it should work fine. (FYI - All Windows XP systems come with it automatically, which is why this is a rare issue nowadays)

Link to GDI download at Microsoft:

http://www.microsoft.com/downloads/details...;displaylang=en

Share this post


Link to post
Share on other sites

That return value is in this function in

; #FUNCTION# ====================================================================================================


================
; Description ...: Initialize Microsoft Windows GDI+
; Parameters ....:
; Return values .: Success    - True
;                 Failure     - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Call _GDIP_Startup before you create any GDI+ objects.  GDI+ requires a redistributable for applications  that
;                 run on the Microsoft Windows NT 4.0 SP6, Windows 2000, Windows 98, and Windows Me operating systems.
; Related .......: _GDIP_Shutdown
; ====================================================================================================


===========================
Func _GDIP_Startup()
  Local $pInput, $tInput, $pToken, $tToken, $aResult

  $giA3LGDIPRef += 1
  if $giA3LGDIPRef > 1 then Return True

  $ghA3LGDIPDll = DllOpen("GDIPlus.dll")
  _Lib_Check("_GDIP_Startup (GDIPlus.dll not found)", @Error, -1)

  $tInput = DllStructCreate($tagGDIPSTARTUPINPUT)
  $pInput = DllStructGetPtr($tInput)
  $tToken = DllStructCreate("int Data")
  $pToken = DllStructGetPtr($tToken)
  DllStructSetData($tInput, "Version", 1)
  $aResult = DllCall($ghA3LGDIPDll, "int", "GdiplusStartup", "ptr", $pToken, "ptr", $pInput, "ptr", 0)
  $giA3LGDIPToken = DllStructGetData($tToken, "Data")
  Return $aResult[0] <> 0
EndFunc

I've nerer seen a return value like this "Return $aResult[0] <> 0"

Although it looks like PaulIA uses this return type in several of his UDF's

Edit: Looks like it makes the return value True or False

I do this often myself for a bool return Chris.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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