Jump to content

Help with Au3lib


Recommended Posts

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

Link to comment
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

Edited by ChrisL
Link to comment
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.

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...