I use a listview to show a database. It has 16 columns and up to 3400 rows.
If i send LVM_DELETEALLITEMS when the listview is full it takes about 30 seconds on my Duron800 Mhz Win98Se 128 Mb ram.
Why ?
If i send LVM_DELETEALLITEMS when the listview is full it takes about 30 seconds on my Duron800 Mhz Win98Se 128 Mb ram.
Why ?
greenant,
Is the list still being displayed when you delete the items, it night be taking so long because it is updating the screen, try switching it off by using LockWindowUpdate :-
to unlock it againm call the function once more.
umbongo.
Is the list still being displayed when you delete the items, it night be taking so long because it is updating the screen, try switching it off by using LockWindowUpdate :-
invoke LockWindowUpdate,hListView
to unlock it againm call the function once more.
umbongo.
nothng has changed.
I will post the code
I will post the code
This is the code. I'm writing a frontend for mame ( www.mame.net)
It is written for masm32. To compile it just "nmake all"
The function DlgWaitLoad is the callback function of a dialogbox. It create a thread that execute a query and fill the database.
Please do not distribuite this code because is under development. To get the latest stable release go to http://greenant.cjb.net.
Sorry bu the english section is under restyling.
It is written for masm32. To compile it just "nmake all"
The function DlgWaitLoad is the callback function of a dialogbox. It create a thread that execute a query and fill the database.
Please do not distribuite this code because is under development. To get the latest stable release go to http://greenant.cjb.net.
Sorry bu the english section is under restyling.
greenant,
sorry but my italian is non-existant, when does this code get executed? Do I have to select a menu item to cause the problem you're having?
umbongo
sorry but my italian is non-existant, when does this code get executed? Do I have to select a menu item to cause the problem you're having?
umbongo
invoke ShowWindow, hList, SW_HIDE
invoke SendMessage, hList, LVM_DELETEALLITEMS,0,0
invoke ShowWindow, hList, SW_SHOW
Looks like a dirty workaround, but hey it works :)
x Bazik
It doesn't work
x umbongo
this is the new code with more comments. Gremaf.asm is the main file.
When the program has to fill the listview calls DialogBoxParam and so the DlgWaitLoad procedure.
This procedure is the callback procedure of the Dialog box with the progress bar.
During the WM_INITDIALOG it creates a thread : RunQuerySelect
RunQuerySelect executes a prepared statement ( prepared with InitQuerySelect ), initializes the progress bar and the listview and then calls FillData.
FillData fetch the rows from the database and puts them in the listview.
You can fill the database in three different ways :
1. When you start Gremaf
2. When you select the Filters Menu --> Refresh list
3. When you change a filter
To cause the problem you have to fill the listview with all the rows ( 3469 ) and then refresh the list.
The time it takes to delete all items is the time you wait between the DialogBox appears and the ProgressBar starts to move.
Excuse me for my English.
It doesn't work
x umbongo
this is the new code with more comments. Gremaf.asm is the main file.
When the program has to fill the listview calls DialogBoxParam and so the DlgWaitLoad procedure.
This procedure is the callback procedure of the Dialog box with the progress bar.
During the WM_INITDIALOG it creates a thread : RunQuerySelect
RunQuerySelect executes a prepared statement ( prepared with InitQuerySelect ), initializes the progress bar and the listview and then calls FillData.
FillData fetch the rows from the database and puts them in the listview.
You can fill the database in three different ways :
1. When you start Gremaf
2. When you select the Filters Menu --> Refresh list
3. When you change a filter
To cause the problem you have to fill the listview with all the rows ( 3469 ) and then refresh the list.
The time it takes to delete all items is the time you wait between the DialogBox appears and the ProgressBar starts to move.
Excuse me for my English.
Your Up/Down arrows bitmaps in header actually are not transparent.
I guess you have captured it from you screen.
Change your system colors and you see'll it.
As i mentioned above the transparent color should be (192,192,192).
But your gray is (189,189,189).
I guess you have captured it from you screen.
Change your system colors and you see'll it.
As i mentioned above the transparent color should be (192,192,192).
But your gray is (189,189,189).
greenant,
Have you tried this on another system? it took under a second to do the operation on my system.
I'm using a PIII 700 (Compaq Deskpro)
and it was fine.
Just as a test, try NOT deleting the listview items (I know it will double the size fo the list) and see how long that takes.
What I am trying to see is if the delete items is really taking all that long.
umbongo
Have you tried this on another system? it took under a second to do the operation on my system.
I'm using a PIII 700 (Compaq Deskpro)
and it was fine.
Just as a test, try NOT deleting the listview items (I know it will double the size fo the list) and see how long that takes.
What I am trying to see is if the delete items is really taking all that long.
umbongo
greenant: aprox half a second delay time after
pressing refresh and progress dialog moving, so no
problem here
same delay on changing filters ...
TBD
pressing refresh and progress dialog moving, so no
problem here
same delay on changing filters ...
TBD
With delete all items the timings are those :
On my Duron 800, 128 Mb ram, Win98 Se, IE 6
I 28 Sec between the Dialog apperars and the progressbar starts to move
II 10 Sec between the progressbar starts to move and the DialogBox disappears
On my pentium 133, 64 Mb ram, Win 98 Se IE 6
I 41 Sec
II 77 Sec
If i remove DELETEALLITEM the progressbar starts to move after no more than a Second
I have tried it on a Athlon 1200, 512 Mb ram, Win 2000, IE 5.5 and it's all ok
I will try Gremaf on other Pc.
On my Duron 800, 128 Mb ram, Win98 Se, IE 6
I 28 Sec between the Dialog apperars and the progressbar starts to move
II 10 Sec between the progressbar starts to move and the DialogBox disappears
On my pentium 133, 64 Mb ram, Win 98 Se IE 6
I 41 Sec
II 77 Sec
If i remove DELETEALLITEM the progressbar starts to move after no more than a Second
I have tried it on a Athlon 1200, 512 Mb ram, Win 2000, IE 5.5 and it's all ok
I will try Gremaf on other Pc.
I have done some test and I noticed that LVM_DELETEALLITEMS works good under Windows 2000 and NT4 nad works bad under 98 and Me.
Please help me doing other tests especially under 95, Me and Xp. Ie 4.01 or greater is required.
Thanks
Please help me doing other tests especially under 95, Me and Xp. Ie 4.01 or greater is required.
Thanks