Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


_ScreenCapture_SaveImage wrong return value


  • Please log in to reply
1 reply to this topic

#1 Guest_christian_*

Guest_christian_*
  • Guests

Posted 29 November 2007 - 05:21 PM

Hi developers!

I have problems with the function _ScreenCapture_SaveImage().

It returns False and sets @error to 1, if the save operation was successful.

I believe the problem is in the last line:
$iResult = _GDIPlus_ImageSaveToFileEx($hImage, $sFileName, $sCLSID, $pParams) ... Return SetError($iResult, 0, $iResult = 0)


_GDIPlus_ImageSaveToFileEx returns True=successful; False = failure.
This return value is inverted and returned by _ScreenCapture_SaveImage.

I changed the code to:
Return SetError($iResult=False, 0, $iResult = True)


and now it seems to work fine.

Maybe there are other functions in ScreenCapture like this, but I didn't checked.

Kind regards,
Christian







#2 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 29 November 2007 - 05:39 PM

Hi developers!

I have problems with the function _ScreenCapture_SaveImage().

It returns False and sets @error to 1, if the save operation was successful.

I believe the problem is in the last line:

$iResult = _GDIPlus_ImageSaveToFileEx($hImage, $sFileName, $sCLSID, $pParams) ... Return SetError($iResult, 0, $iResult = 0)


_GDIPlus_ImageSaveToFileEx returns True=successful; False = failure.
This return value is inverted and returned by _ScreenCapture_SaveImage.

I changed the code to:
Return SetError($iResult=False, 0, $iResult = True)


and now it seems to work fine.

Maybe there are other functions in ScreenCapture like this, but I didn't checked.

Kind regards,
Christian

Thanks, Fixed.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users