Hard crash of Autoit - _ClipBoard_GetData
#1
Posted 16 December 2007 - 10:39 PM
starting this example _ClipBoard_GetData and then pressing
1. Set ClipBoard Data
2. Get ClipBoard Data
leads to AutoIT3.exe ended.rc:-1073741819
(3.2.10.0, XP 2)
So long,
Mega
#2
Posted 16 December 2007 - 10:46 PM
Hi,
starting this example _ClipBoard_GetData and then pressing
1. Set ClipBoard Data
2. Get ClipBoard Data
leads to AutoIT3.exe ended.rc:-1073741819
(3.2.10.0, XP 2)
So long,
Mega
Doesn't crash on my system.
3.2.10.0 XP Pro SP2
SciTE for AutoItDirections for Submitting Standard UDFs
Don't argue with an idiot; people watching may not be able to tell the difference.
#3
Posted 16 December 2007 - 11:34 PM
wenn I do this:
#include <GuiConstantsEx.au3> #include <ClipBoard.au3> Opt('MustDeclareVars', 1) Global $iMemo _Main() Func _Main() Local $hGUI, $btn_SetData, $btn_GetData ; Create GUI $hGUI = GUICreate("Clipboard", 600, 450) $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") $btn_SetData = GUICtrlCreateButton("Set ClipBoard Data", 150, 410, 120, 30) $btn_GetData = GUICtrlCreateButton("Get ClipBoard Data", 300, 410, 120, 30) GUISetState() ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) ; Loop until user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn_SetData ;_ClipBoard_SetData("ClipBoard Library") ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) Case $btn_GetData MemoWrite(_ClipBoard_GetData()) EndSwitch WEnd EndFunc ;==>_Main ; Write message to memo Func MemoWrite($sMessage = "") GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite
and then press the GET Button or get,set,get,set,get,set then Autoit crashes for me.
So long,
Mega
#4
Posted 16 December 2007 - 11:52 PM
#5
Posted 16 December 2007 - 11:58 PM
#include <GuiConstantsEx.au3> #include <ClipBoard.au3> Opt('MustDeclareVars', 1) Global $iMemo _Main() Func _Main() Local $hGUI, $btn_SetData, $btn_GetData ; Create GUI $hGUI = GUICreate("Clipboard", 600, 450) $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") $btn_SetData = GUICtrlCreateButton("Set ClipBoard Data", 150, 410, 120, 30) $btn_GetData = GUICtrlCreateButton("Get ClipBoard Data", 300, 410, 120, 30) GUISetState() ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) ; Loop until user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn_SetData ;_ClipBoard_SetData("ClipBoard Library") ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) Case $btn_GetData If _ClipBoard_Open($hGUI) Then If _ClipBoard_CountFormats() Then MemoWrite("Formats: " & _ClipBoard_CountFormats()) MemoWrite(_ClipBoard_GetData()) EndIf _ClipBoard_Close() EndIf EndSwitch WEnd EndFunc ;==>_Main ; Write message to memo Func MemoWrite($sMessage = "") GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite
SciTE for AutoItDirections for Submitting Standard UDFs
Don't argue with an idiot; people watching may not be able to tell the difference.
#6
Posted 17 December 2007 - 12:00 AM
I don't think so. I crahses for somebody else too. I doesn't always crash the first time. But after playing around a bit with copy & paste and empty CB it crashes.
So long,
Mega
#7
Posted 17 December 2007 - 12:04 AM
this one should make it reproducable for you:
#include <GuiConstantsEx.au3> #include <ClipBoard.au3> Opt('MustDeclareVars', 1) Global $iMemo _Main() Func _Main() Local $hGUI, $btn_SetData, $btn_GetData ; Create GUI $hGUI = GUICreate("Clipboard", 600, 450) $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") $btn_SetData = GUICtrlCreateButton("Set ClipBoard Data", 150, 410, 120, 30) $btn_GetData = GUICtrlCreateButton("Get ClipBoard Data", 300, 410, 120, 30) GUISetState() If Not _ClipBoard_Open($hGUI) Then _WinAPI_ShowError("_ClipBoard_Open failed") ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) _ClipBoard_Close() ; Loop until user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn_SetData ;_ClipBoard_SetData("ClipBoard Library") ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) Case $btn_GetData MemoWrite(_ClipBoard_GetData()) EndSwitch WEnd EndFunc ;==>_Main ; Write message to memo Func MemoWrite($sMessage = "") GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite
Run the script press getButton an 0 appears copy it with CTRL+C and then press the getButton a few times.
EDIT: I give up! I cannot get to be reproduceable.
So long,
Mega
Edited by Xenobiologist, 17 December 2007 - 12:08 AM.
#8
Posted 17 December 2007 - 12:28 AM
Hi,Hi,
wenn I do this:
AutoIt#include <GuiConstantsEx.au3> #include <ClipBoard.au3> Opt('MustDeclareVars', 1) Global $iMemo _Main() Func _Main() Local $hGUI, $btn_SetData, $btn_GetData ; Create GUI $hGUI = GUICreate("Clipboard", 600, 450) $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") $btn_SetData = GUICtrlCreateButton("Set ClipBoard Data", 150, 410, 120, 30) $btn_GetData = GUICtrlCreateButton("Get ClipBoard Data", 300, 410, 120, 30) GUISetState() ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) ; Loop until user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn_SetData ;_ClipBoard_SetData("ClipBoard Library") ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) Case $btn_GetData MemoWrite(_ClipBoard_GetData()) EndSwitch WEnd EndFunc ;==>_Main ; Write message to memo Func MemoWrite($sMessage = "") GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite
and then press the GET Button or get,set,get,set,get,set then Autoit crashes for me.
So long,
Mega
I have tested it too and windows crashes too.
I think this is a bug.
Please help us
Thanks
Edited by Tweaky, 17 December 2007 - 12:35 AM.
#9
Posted 17 December 2007 - 12:50 AM
Hi,
I have tested it too and windows crashes too.
I think this is a bug.
Please help us
Thanks
If windows crashes you have bigger problem then the script might have.
SciTE for AutoItDirections for Submitting Standard UDFs
Don't argue with an idiot; people watching may not be able to tell the difference.
#10
Posted 17 December 2007 - 12:55 AM
I guess he meant that Autoit crashes. It crashes with the typical memory error message. Autoit tries to read a memory address and this fails.
So long,
Mega
#11
Posted 17 December 2007 - 12:56 AM
Not a Bug, incorrect use of the _ClipBoardEmptyHi,
this one should make it reproducable for you:
Run the script press getButton an 0 appears copy it with CTRL+C and then press the getButton a few times.
EDIT: I give up! I cannot get to be reproduceable.Sorry!
So long,
Mega
#include <GuiConstantsEx.au3> #include <ClipBoard.au3> Opt('MustDeclareVars', 1) Global $iMemo _Main() Func _Main() Local $hGUI, $btn_SetData, $btn_GetData ; Create GUI $hGUI = GUICreate("Clipboard", 600, 450) $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") $btn_SetData = GUICtrlCreateButton("Set ClipBoard Data", 150, 410, 120, 30) $btn_GetData = GUICtrlCreateButton("Get ClipBoard Data", 300, 410, 120, 30) GUISetState() ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) ; Loop until user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn_SetData ;_ClipBoard_SetData("ClipBoard Library") If _ClipBoard_Open($hGUI) Then ConsoleWrite("CB_EMPTY: " & _ClipBoard_Empty() & @CRLF) _ClipBoard_Close() EndIf Case $btn_GetData MemoWrite(_ClipBoard_GetData()) EndSwitch WEnd EndFunc ;==>_Main ; Write message to memo Func MemoWrite($sMessage = "") GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite
From the remarks of _ClipBoard_Empty
Before calling this function, you must open the clipboard by using the _ClipBoard_Open function.
SciTE for AutoItDirections for Submitting Standard UDFs
Don't argue with an idiot; people watching may not be able to tell the difference.
#12
Posted 17 December 2007 - 01:07 AM
yes okay.
But should Autoit crash?
I don't think so.
But maybe it is very difficult to avoid crashing because there was added so much WINAPI stuff .
So long,
Mega
#13
Posted 17 December 2007 - 01:34 AM
We can't prevent crashes when DllCall() is used incorrectly. That's the price you pay for using a "lower-level" function.Hi,
yes okay.
But should Autoit crash?
I don't think so.
But maybe it is very difficult to avoid crashing because there was added so much WINAPI stuff .
So long,
Mega
#14
Posted 17 December 2007 - 11:28 AM
We can't prevent crashes when DllCall() is used incorrectly. That's the price you pay for using a "lower-level" function.
Hi,
okay, I already thought that. But I also thought that using the Autoit funcs which handle the DLLCalls (WinApi) is a layer between me and the DLLCall. So, it can be protected.
But I guess it would be very hard to think about all the possibilities.
So, thanks for clarification.
So long,
Mega
#15
Posted 27 December 2007 - 02:15 PM
I guess this should be handled by AutoIt3' in source core.
#16
Posted 27 December 2007 - 02:20 PM
I have tested this script on Vista and XP SP2, and got crashes. So currently it is not safe to read from clipboard for the script.
I guess this should be handled by AutoIt3' in source core.
Hi,
the answer was. Only using the API stuff wrong leads to errors.
So long,
Mega
#17
Posted 07 January 2008 - 09:35 PM
_ClipBoard_GetData($CF_TEXT)
crashed for me also. And on two different computer also.
Not always on first occasion, but it does crash.
XP2 and 3210.
Silent error code is "AutoIT3.exe ended.rc:-1073741819"
#18
Posted 07 January 2008 - 09:38 PM
Simple
_ClipBoard_GetData($CF_TEXT)
crashed for me also. And on two different computer also.
Not always on first occasion, but it does crash.
XP2 and 3210.
Silent error code is "AutoIT3.exe ended.rc:-1073741819"
The crystal ball tells me you are using it incorrectly also.
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




