Custom Query (3927 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (67 - 69 of 3927)

Ticket Resolution Summary Owner Reporter
#3996 No Bug Unexpected silent conversion of several AutoIt types when used as keys in maps anonymous
Description

(this applies to all versions from 3.3.15.0 to 3.3.16.1) In maps, when we use a float, a pointer, or a keyword (any of default/null/true/false) as a key, then the following unexpected (i.e. this behaviour is undocumented) conversion happens:

  • floats become ints; eg float 3.14159 becomes int 3
  • pointers/handles become ints as well: Ptr(0xCAFE) becomes int 51966
  • true becomes int 1;
  • any other keyword (default/null/false), and in fact any other type - funcs, maps(!), arrays(!!), dllstructs(!!!), even ur mom(untested...), - all that becomes int 0

What would be the most best, is to allow these additional sensible types to be used as keys. The additional sensible types are of course pointers/handles (i use them all the time when working with windows and GUIs as keys in a map; super useful!), floats, and (in my opinion) keywords.

And at the very least, this should be documented in the helpfile. Thank you for consideration! :)

PS. Well well well.. while researching this bug, i found even more unexpected things! the following snippet works perfectly fine in 3.3.15.0 and 3.3.15.1, but starting from 3.3.15.2 to 3.3.16.1 AutoIt completely crashes on it!

Global $m[], $p1 = ptr(0xCAFE), $p2 = ptr(0xCAFEBABE)
ConsoleWrite('setting Ptr('&$p1&') to 2357' & @CRLF)
$m[$p1] = 2357
ConsoleWrite('retrieving: '&$m[$p1] & @CRLF)
ConsoleWrite('setting Ptr('&$p2&') to 777' & @CRLF)
$m[$p2] = 777
ConsoleWrite('retrieving: '&$m[$p2] & @CRLF)
ConsoleWrite('-----now do the same, but via MapKeys in  For..in..next  loop---------' & @CRLF)
for $key in MapKeys($m)
  ConsoleWrite('key '&VarGetType($key)&' : '& $key & @CRLF)
  ConsoleWrite('data '&VarGetType($m[$key]) &' : '& $m[$key] & @CRLF)
next
#3994 No Bug AutoIT crashes in IsDeclared if $vVar is not declared torchrish@…
Description

#include-once #include <AutoItConstants.au3>

If IsDeclared($vVar) <> $DECLARED_UNKNOWN Then Exit(-1)

#3993 No Bug _WinAPI_SetWindowTheme() - remove limits argumentum
Description

Trying to change a color on a checkbox control I needed to remove the theme and found the limitation on the implementation of the wrapper. The request is to remove the "string or null, only" from the func., as zero is the value that is needed in this case.

#include <WinAPITheme.au3>
Test()
Func Test()
	GUICreate(@ScriptName)

	GUICtrlCreateCheckbox("one", 10, 10, 200)

	GUICtrlCreateCheckbox("two", 10, 30, 200)
	GUICtrlSetColor(-1, 0xFF00FF)

	GUICtrlCreateCheckbox("three", 10, 50, 200)
	_WinAPI_SetWindowTheme(GUICtrlGetHandle(-1)) ;, 0, 0)
	GUICtrlSetColor(-1, 0xFF00FF)

	GUICtrlCreateCheckbox("Four", 10, 70, 200)
	_WinAPI_SetWindowTheme_mod(GUICtrlGetHandle(-1)) ;, 0, 0)
	GUICtrlSetColor(-1, 0xFF00FF)

	GUISetState()
	While GUIGetMsg() <> -3
	WEnd
	GUIDelete()
EndFunc

Func _WinAPI_SetWindowTheme_mod($hWnd, $sName = Default, $sList = Default) ; #include <WinAPITheme.au3>
;~ 	If Not IsString($sName) Then $sName = Null ; <-- this limits what can get done with it.
;~ 	If Not IsString($sList) Then $sList = Null ; also, don't ask me why "Default" works !, I was going to use 0

	Local $sResult = DllCall('UxTheme.dll', 'long', 'SetWindowTheme', 'hwnd', $hWnd, 'wstr', $sName, 'wstr', $sList)
	If @error Then Return SetError(@error, @extended, 0)
	If $sResult[0] Then Return SetError(10, $sResult[0], 0)
	Return 1
EndFunc   ;==>_WinAPI_SetWindowTheme
Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.