Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Select Grid Row BY ID
Select Grid Row BY ID [message #48009] Fri, 05 May 2017 19:32 Go to previous message
germax is currently offline  germax
Messages: 20
Registered: March 2017
Location: germany
Promising Member
Hi, got a severe problem atm which needs to be solved by tomorrow Sad

It's this:
I have a gridGrtl which is filled with csv values..

Now I need to "check" it's entries for duplicates against a database (external mysql)
so far so good, in single threaded mode I just go through each rows backwards
(starting from the last)

remove each row which is a duplicate until I hit row zero.

With a local db that's reasonably fast and everything is great..
with a remote db that takes a loong time, during which the GUI tends to blank out
not refreshing properly and basically looking "crashed"

So I added a CoWorker to do all the checking against the MySQL.
And that just doesn't want to work out for me..

In that worker-function
If I use the row-id as a reference (grid.GetRow(rownum))
since the multiple threads are not "ordered by descending rowids" the rowid of a specific row changes as a previous thread deleted a row... causing all sorts of errors occasionally (by chance)

if I use the rows preset ID (grid.AddIndex(ID)Wink
and accessing the row by ID (int rownum = grid.Find(rowid, ID); grid.GetRow(rownum))
the program compiles flawlessly but terminates with a runtime error
(I assume the row Id changes during execution since a concurrent thread deletes a row)

it's a sheer PITA to not being able to just grid[rowid].doStuff() with a ficxed rowid not irritated by sortorder or number of rows or position of row on the grid...

Any advice?

When I use a more linear MT model (say the one of the


that other german guy
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Minor "mistake" in <CtrlLib/ArrayCtrl.h>
Next Topic: Insert Ctrl editors in a single row of ArrayCtrl
Goto Forum:
  


Current Time: Thu Mar 28 16:43:39 CET 2024

Total time taken to generate the page: 0.01313 seconds