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


Photo

Hard crash of Autoit - _ClipBoard_GetData


  • Please log in to reply
17 replies to this topic

#1 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,840 posts

Posted 16 December 2007 - 10:39 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

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times








#2 GaryFrost

GaryFrost

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

  • Developers
  • 7,854 posts

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 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,840 posts

Posted 16 December 2007 - 11:34 PM

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

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times


#4 JustinReno

JustinReno

    My custom made Vortex.

  • Banned (NOT IN USE)
  • 2,330 posts

Posted 16 December 2007 - 11:52 PM

It works for me, maybe you have a memory leak (Or something like that). I had one with MicroOS, which still never was fixed. :)

#5 GaryFrost

GaryFrost

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

  • Developers
  • 7,854 posts

Posted 16 December 2007 - 11:58 PM

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

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,840 posts

Posted 17 December 2007 - 12:00 AM

Hi,

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

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times


#7 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,840 posts

Posted 17 December 2007 - 12:04 AM

Hi,

this one should make it reproducable for you:

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()      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. :) Sorry!

So long,

Mega

Edited by Xenobiologist, 17 December 2007 - 12:08 AM.

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times


#8 Tweaky

Tweaky

    Wayfarer

  • Active Members
  • Pip
  • 77 posts

Posted 17 December 2007 - 12:28 AM

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

Hi,
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 GaryFrost

GaryFrost

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

  • Developers
  • 7,854 posts

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 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,840 posts

Posted 17 December 2007 - 12:55 AM

Hi,

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

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times


#11 GaryFrost

GaryFrost

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

  • Developers
  • 7,854 posts

Posted 17 December 2007 - 12:56 AM

Hi,

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

Not a Bug, incorrect use of the _ClipBoardEmpty

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")                 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 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,840 posts

Posted 17 December 2007 - 01:07 AM

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

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times


#13 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 17 December 2007 - 01:34 AM

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

We can't prevent crashes when DllCall() is used incorrectly. That's the price you pay for using a "lower-level" function.

#14 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,840 posts

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

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times


#15 Greenya

Greenya

    Seeker

  • Active Members
  • 5 posts

Posted 27 December 2007 - 02:15 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.

#16 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,840 posts

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

Scripts & functions Organize Includes Let Scite organize the include files *new

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times


#17 Ármányos Kő

Ármányos Kő

    Wayfarer

  • Active Members
  • Pip
  • 72 posts

Posted 07 January 2008 - 09:35 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"

#18 GaryFrost

GaryFrost

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

  • Developers
  • 7,854 posts

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