Opened on Jun 16, 2011 at 9:30:02 PM
Closed on Sep 9, 2013 at 1:22:27 PM
#1954 closed Bug (Fixed)
ListViewItem returns 0 (failure) even though it populates the ListView
| Reported by: | anonymous | Owned by: | Jon |
|---|---|---|---|
| Milestone: | 3.3.9.21 | Component: | AutoIt |
| Version: | 3.3.6.1 | Severity: | None |
| Keywords: | Cc: |
Description
When more sub-items are specified in the “text” parameter of function GUICtrlCreateListViewItem, the list view is populated with the sub-items that fit the ListView, but the control ID returned is 0.
The following script demonstrates this anomaly. In particular, $item2 is assigned 0 because it has one too many sub-items. The ID’s of each ListViewItem are shown in the input box.
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $listview, $item1, $item2, $item3, $input1, $msg
GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES)
$listview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
$item1 = GUICtrlCreateListViewItem("1a|1b|1c", $listview)
$item2 = GUICtrlCreateListViewItem("2a|2b|2c|2d", $listview)
$item3 = GUICtrlCreateListViewItem("3a|3b|3c", $listview)
$input1 = GUICtrlCreateInput("$item1 = " & $item1 & ", $item2 = " & $item2 & ", $item3 = " & $item3, 10, 200, 200, 15)
GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Attachments (0)
Change History (5)
comment:2 by , on Nov 7, 2011 at 10:51:05 PM
Here is another modification
;~ $item2 = GUICtrlCreateListViewItem("2a|2b|2c|2d", $listview)
$item2 = GUICtrlCreateListViewItem("2a|2b", $listview)
In this case: less (only two) columns given it sucessfully create listview item and also corect nonzero control ID is returned.
So there is question if in case of more columns given shouldn't be returned correct nonzero control ID if Autoit can display it correctly (cut thrid unnecessary column internally)?
comment:3 by , on Jul 21, 2013 at 11:31:57 PM
| Resolution: | → Rejected |
|---|---|
| Status: | new → closed |
comment:4 by , on Sep 7, 2013 at 10:39:16 AM
| Resolution: | Rejected |
|---|---|
| Status: | closed → reopened |
comment:5 by , on Sep 9, 2013 at 1:22:27 PM
| Milestone: | → 3.3.9.21 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | reopened → closed |
Fixed by revision [8992] in version: 3.3.9.21

The $item2 is really invalid as it try to defined more field than the list number of columns can have.
The bug is it should not be displayed. Bad internal error handling.