Lupo73 Posted September 19, 2013 Share Posted September 19, 2013 (edited) The 64bit version of a program I'm developing no longer works under Win8 64bit after the last update (one of the changes is the use of AutoIt 3.3.9.21 to fix a FTP issue). The 32bit version works fine instead and also the previous 64bit version (compiled with AutoIt 3.3.8.1). I'm not sure the problem is the beta version of AutoIt, but after some tests of a collaborator, I found where the code stops to work (and is a part not changed with the update). In one of these lines: Local $gBitmap, $gContext, $gIcon, $gImageHeight, $gImageWidth $gImage = _GDIPlus_BitmapCreateFromFile($gImageFile) $gImageWidth = _GDIPlus_ImageGetWidth($gImage) $gImageHeight = _GDIPlus_ImageGetHeight($gImage) If $gImageWidth < 0 Or $gImageHeight < 0 Then Return SetError(1, 0, 0) EndIf If $gImageWidth < $gImageHeight Then $gImageWidth = $gWidth * $gImageWidth / $gImageHeight $gImageHeight = $gHeight Else $gImageHeight = $gHeight * $gImageHeight / $gImageWidth $gImageWidth = $gWidth EndIf $gBitmap = _GDIPlus_BitmapCreateFromScan0($gWidth, $gHeight) $gContext = _GDIPlus_ImageGetGraphicsContext($gBitmap) _GDIPlus_GraphicsDrawImageRect($gContext, $gImage, 0, 0, $gWidth, $gHeight) $gIcon = _GDIPlus_BitmapCreateHBITMAPFromBitmap($gBitmap) _GUICtrlMenu_SetItemBmp($gHandle, $gIndex, $gIcon) _GDIPlus_GraphicsDispose($gContext) _GDIPlus_BitmapDispose($gBitmap) _GDIPlus_BitmapDispose($gImage) An user that help me with tests reported also this event log (even if I'm not sure how it could helps): Faulting application name: DropIt.exe, version: 5.3.0.0, time stamp: 0x5222feab Faulting module name: GDIPlus.dll, version: 6.2.9200.16518, time stamp: 0x510ca4c2 Exception code: 0xc0000005 Fault offset: 0x000000000001925f Faulting process id: 0xbc4 Faulting application start time: 0x01ceb388d324c819 Faulting application path: C:Program FilesDropItDropIt.exe Faulting module path: C:WINDOWSWinSxSamd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9200.16518_none_726fbfe0cc22f012GDIPlus.dll Report Id: 117882a4-1f7c-11e3-8089-f46d04503185 Faulting package full name: Faulting package-relative application ID: Thanks for your help! Edited September 23, 2013 by Lupo73 SFTPEx, AutoCompleteInput, _DateTimeStandard(), _ImageWriteResize(), _GUIGraduallyHide(): some AutoIt functions. Lupo PenSuite: all-in-one and completely free selection of portable programs and games. DropIt: a personal assistant to automatically manage your files. ArcThemALL!: application to multi-archive your files and folders. Link to comment Share on other sites More sharing options...
Lupo73 Posted September 26, 2013 Author Share Posted September 26, 2013 (edited) After more tests, the result is that the crash occurs with _GDIPlus_ImageGetGraphicsContext() function. Are there changes in this function from AutoIt 3.3.8.1 to 3.3.9.21? Or maybe a problem in _GDIPlus_BitmapCreateFromScan0() function under Win8 64bit. Thanks for the help. Edited September 26, 2013 by Lupo73 SFTPEx, AutoCompleteInput, _DateTimeStandard(), _ImageWriteResize(), _GUIGraduallyHide(): some AutoIt functions. Lupo PenSuite: all-in-one and completely free selection of portable programs and games. DropIt: a personal assistant to automatically manage your files. ArcThemALL!: application to multi-archive your files and folders. Link to comment Share on other sites More sharing options...
trancexx Posted September 26, 2013 Share Posted September 26, 2013 Some new functions that are added to GDIPlus.au3 aren't x64 aware. For example _GDIPlus_BitmapCreateFromScan0. That's where your problem very likely is. You can manually change last param for DllCall to "ptr*" instead of current "int*". ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
UEZ Posted September 26, 2013 Share Posted September 26, 2013 (edited) It is always a good idea to make error checks when using functions from the new GDIPlus.au3 Local $gBitmap, $gContext, $gIcon, $gImageHeight, $gImageWidth $gImage = _GDIPlus_BitmapCreateFromFile($gImageFile) ConsoleWrite("Error: " & @error & ", $gImage: & " & $gImage & @LF) $gImageWidth = _GDIPlus_ImageGetWidth($gImage) $gImageHeight = _GDIPlus_ImageGetHeight($gImage) If $gImageWidth < 0 Or $gImageHeight < 0 Then Return SetError(1, 0, 0) EndIf If $gImageWidth < $gImageHeight Then $gImageWidth = $gWidth * $gImageWidth / $gImageHeight $gImageHeight = $gHeight Else $gImageHeight = $gHeight * $gImageHeight / $gImageWidth $gImageWidth = $gWidth EndIf $gBitmap = _GDIPlus_BitmapCreateFromScan0($gWidth, $gHeight) ConsoleWrite("Error: " & @error & ", $gBitmap: & " & $gBitmap & @LF) $gContext = _GDIPlus_ImageGetGraphicsContext($gBitmap) ConsoleWrite("Error: " & @error & ", $gContext: & " & $gContext & @LF) _GDIPlus_GraphicsDrawImageRect($gContext, $gImage, 0, 0, $gWidth, $gHeight) $gIcon = _GDIPlus_BitmapCreateHBITMAPFromBitmap($gBitmap) _GUICtrlMenu_SetItemBmp($gHandle, $gIndex, $gIcon) _GDIPlus_GraphicsDispose($gContext) _GDIPlus_BitmapDispose($gBitmap) _GDIPlus_BitmapDispose($gImage) If error is 0 but return value is 0 or -1 then something went wrong. I will check the new GDIPlus examples in my Win8.1 x64 environment. Br, UEZ Edited September 26, 2013 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Lupo73 Posted October 2, 2013 Author Share Posted October 2, 2013 Thanks for the help, I'll do more tests (unfortunately I don't have win8 64bit, so I have to ask tests to my users). SFTPEx, AutoCompleteInput, _DateTimeStandard(), _ImageWriteResize(), _GUIGraduallyHide(): some AutoIt functions. Lupo PenSuite: all-in-one and completely free selection of portable programs and games. DropIt: a personal assistant to automatically manage your files. ArcThemALL!: application to multi-archive your files and folders. Link to comment Share on other sites More sharing options...
UEZ Posted October 2, 2013 Share Posted October 2, 2013 I hope in the next beta release all issues running the code as x64 in a Win8 environment are solved. We made several modifications to the functions and examples. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Lupo73 Posted October 2, 2013 Author Share Posted October 2, 2013 I replaced "ptr*" instead of "int*" and now it works, thanks! SFTPEx, AutoCompleteInput, _DateTimeStandard(), _ImageWriteResize(), _GUIGraduallyHide(): some AutoIt functions. Lupo PenSuite: all-in-one and completely free selection of portable programs and games. DropIt: a personal assistant to automatically manage your files. ArcThemALL!: application to multi-archive your files and folders. Link to comment Share on other sites More sharing options...
Lupo73 Posted October 6, 2013 Author Share Posted October 6, 2013 Still problems. Now my program works, but crashes using some features. I'm starting new tests. Is there a list of already known issues that will be fixed in next beta release? Thanks! SFTPEx, AutoCompleteInput, _DateTimeStandard(), _ImageWriteResize(), _GUIGraduallyHide(): some AutoIt functions. Lupo PenSuite: all-in-one and completely free selection of portable programs and games. DropIt: a personal assistant to automatically manage your files. ArcThemALL!: application to multi-archive your files and folders. Link to comment Share on other sites More sharing options...
UEZ Posted October 7, 2013 Share Posted October 7, 2013 (edited) Following functions have been fixed (running code as x64):_GDIPlus_BitmapCreateFromResource -> icon cannot be extracted from taskmgr.exe_GDIPlus_BitmapCreateFromScan0 -> crashing needs modification -> "int*" to "handle*" or "ptr*"_GDIPlus_BitmapLockBits example not working because of _GDIPlus_BitmapCreateFromScan0 bug_GDIPlus_ColorMatrixCreate -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_ColorMatrixCreateGrayScale -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_ColorMatrixCreateNegative -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_ColorMatrixCreateSaturation -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_ColorMatrixCreateScale -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_ColorMatrixCreateTranslate -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_GraphicsDrawImageRectRect -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_HICONCreateFromBitmap example not working because of _GDIPlus_BitmapCreateFromScan0 bug_GDIPlus_ImageAttributesCreate -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_ImageAttributesDispose -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_ImageAttributesSetColorKeys -> crashing on _GDIPlus_GraphicsDrawImageRectRect function_GDIPlus_ImageLoadFromStream -> crashing on _GDIPlus_GraphicsDrawImage function -> JPG not compressed_GDIPlus_ImageSaveToStream -> not working properly (no JPG compression)_WinAPI_BitBlt example not working because of _GDIPlus_BitmapCreateFromScan0 bugMaybe also some more.Br,UEZ Edited October 7, 2013 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now