Jump to content
Sign in to follow this  
malu05

Listview with over 4097 items.

Recommended Posts

malu05

I created this tool that works like a database viewer.

And it worked flawlessly until the databases began to exceeded the 4097 control item limit per window.

Then the GUICtrlCreateListViewItem returned 0 for every new item.

How can I approach this problem, and have no limit in how many items i can have in my Listview?


[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

Share this post


Link to post
Share on other sites
Melba23

malu05,

From the Help file for 3.3.0.0:

GUI_MAXCONTROLS 65532 Maximum number of controls in GUI box

I know it is not an answer, but from where do you get a limit of 4097?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
malu05

malu05,

From the Help file for 3.3.0.0:

GUI_MAXCONTROLS 65532 Maximum number of controls in GUI box

I know it is not an answer, but from where do you get a limit of 4097?

M23

#65358

and...

....
Created Listviewitem: 4017
Created Listviewitem: 4019
Created Listviewitem: 4021
Created Listviewitem: 4023
Created Listviewitem: 4025
Created Listviewitem: 4027
Created Listviewitem: 4029
Created Listviewitem: 4031
Created Listviewitem: 4033
Created Listviewitem: 4035
Created Listviewitem: 4037
Created Listviewitem: 4039
Created Listviewitem: 4041
Created Listviewitem: 4043
Created Listviewitem: 4045
Created Listviewitem: 4047
Created Listviewitem: 4049
Created Listviewitem: 4051
Created Listviewitem: 4053
Created Listviewitem: 4055
Created Listviewitem: 4057
Created Listviewitem: 4059
Created Listviewitem: 4061
Created Listviewitem: 4063
Created Listviewitem: 4065
Created Listviewitem: 4067
Created Listviewitem: 4069
Created Listviewitem: 4071
Created Listviewitem: 4073
Created Listviewitem: 4075
Created Listviewitem: 4077
Created Listviewitem: 4079
Created Listviewitem: 4081
Created Listviewitem: 4083
Created Listviewitem: 4085
Created Listviewitem: 4087
Created Listviewitem: 4089
Created Listviewitem: 4091
Created Listviewitem: 4093
Created Listviewitem: 4095
Created Listviewitem: 4097
Created Listviewitem: 0
Created Listviewitem: 0
Created Listviewitem: 0
Created Listviewitem: 0
Created Listviewitem: 0
Created Listviewitem: 0
Created Listviewitem: 0
Created Listviewitem: 0
Created Listviewitem: 0
....

[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

Share this post


Link to post
Share on other sites
PsaltyDS

I created this tool that works like a database viewer.

And it worked flawlessly until the databases began to exceeded the 4097 control item limit per window.

Then the GUICtrlCreateListViewItem returned 0 for every new item.

How can I approach this problem, and have no limit in how many items i can have in my Listview?

Are you running the current version (3.3.0.0)? This demo adds items in blocks of 8,192 (8K):
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt("GuiOnEventMode", 1)

Global $listview, $button, $iItem = 1

GUICreate("listview items", 225, 250, 100, 200)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit")
$listview = GUICtrlCreateListView("   Item No.      ", 10, 10, 205, 180)
GUICtrlSetOnEvent(-1, "_ListView")
$button = GUICtrlCreateButton("Add Items", 75, 200, 75, 30)
GUICtrlSetOnEvent(-1, "_Button")
GUISetState()

While 1
    Sleep(20)
WEnd

Func _Button()
; Add items in 8K blocks
    For $i = $iItem To $iItem + 8191
        $iCtrlID = GUICtrlCreateListViewItem("Item " & $i, $listview)
        If $iCtrlID = 0 Then
            ConsoleWrite("Debug: Failed to add item at $i = " & $i & @LF)
            ExitLoop
        Else
            GUICtrlSetOnEvent($iCtrlID, "_ListViewItem")
        EndIf
    Next
    $iItem = $i
EndFunc  ;==>_Button

Func _ListView()
    ConsoleWrite("listview clicked = " & @GUI_CtrlId & @LF)
EndFunc  ;==>_ListView

Func _ListViewItem()
    ConsoleWrite("listview item clicked, ID = " & @GUI_CtrlId & "  Text = " & GUICtrlRead(@GUI_CtrlId) & @LF)
EndFunc  ;==>_ListView

Func _Quit()
    Exit
EndFunc  ;==>_Quit

:)

Edit: Better demo in event mode.

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
malu05

Are you running the current version (3.3.0.0)? This demo adds items in blocks of 8,192 (8K):

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $listview, $button, $i = 1

GUICreate("listview items", 225, 250, 100, 200)

$listview = GUICtrlCreateListView("   Item No.      ", 10, 10, 205, 180)
$button = GUICtrlCreateButton("Add Items", 75, 200, 75, 30)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $button
    ; Add items in 8K blocks
            For $i = $i To $i + 8191
                If Not GUICtrlCreateListViewItem("Item " & $i, $listview) Then
                    ConsoleWrite("Debug: Failed to add item at $i = " & $i & @LF)
                    ExitLoop
                EndIf
            Next
        Case $listview
            MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

:)

Seems like i forgot to update it all...

Just reinstalled it and now it works ^^


[center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center]

Share this post


Link to post
Share on other sites
Melba23

I do not want to say "I told you so", but............ :-)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.