Modify

Opened 14 years ago

Closed 14 years ago

#2138 closed Bug (Fixed)

GuiCtrlRead with GUICtrlSendToDummy

Reported by: stroket@… Owned by: Valik
Milestone: 3.3.9.1 Component: AutoIt
Version: 3.3.8.1 Severity: None
Keywords: Dummy GUICtrlSendToDummy GUI Cc: stroket@…

Description

GuiCtrlRead(Dummy Ctrl-ID Set By GUICtrlSendToDummy) returns a deformed version of the string used in GUICtrlSendToDummy.

#include <GUIConstants.au3>

local $sTest = "Test String Variable"
local $GUI = GuiCreate("Bug", 128, 64), $MSG
local $BTN = GuiCtrlCreateButton($sTest, 0, 0, 128, 64)
local $DUM = GuiCtrlCreateDummy()
GuiSetState()
while 1
	$MSG = GuiGetMsg()
	switch $MSG
		case $GUI_EVENT_CLOSE
			exit
		case $BTN ; Press the button multiple times
			GUICtrlSendToDummy($DUM, String($sTest)) ; Only seems to happen with variables that are strings.
			; Doesn't seem to cause the bug by just using $sTest, but directly putting in a string
			; (or using the string function) will cause the string to become sexualized.
			; GuiCtrlRead is what actually causes the problem.
		case $DUM
			$sTest = GuiCtrlRead($DUM)
			GuiCtrlSetData($BTN, $sTest) ; Rename the button.
			ConsoleWrite($sTest & @CRLF)
	endswitch
wend

Attachments (0)

Change History (3)

comment:1 by Valik, 14 years ago

Actually the call to String() is unnecessary. Adding that call means you only have to click the button twice instead of 3 times.

Anyway, this is actually a crash under the debugger. Not sure what's causing it at the moment, though.

comment:2 by Valik, 14 years ago

Never mind, I found the bug. Stupid stupid stupid stupid stupid code.

I'll fix it later.

comment:3 by Valik, 14 years ago

Milestone: 3.3.9.1
Owner: set to Valik
Resolution: Fixed
Status: newclosed

Fixed by revision [6815] in version: 3.3.9.1

Modify Ticket

Action
as closed The owner will remain Valik.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.