Jump to content

Recommended Posts

Posted

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?

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
Posted

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

Posted

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

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
Posted

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.

  • 1 month later...
  • Moderators
Posted

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.

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
×
×
  • Create New...