Search found 3 matches

by kou
Wed Nov 29, 2017 12:18 am
Forum: C++ Development
Topic: load list item in thread.And then error [vector.h(404) assert "idx < m_size" failed in at().] has occurred.
Replies: 5
Views: 489

Re: load list item in thread.And then error [vector.h(404) assert "idx < m_size" failed in at().] has occurred.

doublemax wrote:You should not access GUI elements from a worker thread.
Thank you.
So is there any way to speed up loading list?
by kou
Tue Nov 28, 2017 1:48 am
Forum: C++ Development
Topic: load list item in thread.And then error [vector.h(404) assert "idx < m_size" failed in at().] has occurred.
Replies: 5
Views: 489

load list item in thread.And then error [vector.h(404) assert "idx < m_size" failed in at().] has occurred.

I use class wxTreeListCtrl to make the list.And load list item within function AppendItem. But it's spent a lot of time when list item is too large. So I try to load part of the list item use wxThread. But when I load item in thread ,then error [......vector.h(404) assert "idx < m_size" failed in at...
by kou
Tue Nov 28, 2017 1:04 am
Forum: wxWidgets Development (Chinese)
Topic: error [vector.h(404) assert "idx < m_size" failed in at().]
Replies: 1
Views: 926

error [vector.h(404) assert "idx < m_size" failed in at().]

我用 wxTreeListCtrl 的 AppendItem 函数 进行 List 的作成。 但是List的数量变得很大时,速度就会很慢。 所以 为了改进这个问题,我把一部分的 item的加载处理放到 wxThread里进行,我新建了 全局的 wxTreeListCtrl 的类, 然后通过 wxThread 线程函数 把List作成了,通过 AppendItem 函数。 但是 作成时候 出现了[.......vector.h(404) assert "idx < m_size" failed in at().] 这个错误,查阅很多资料,相关记载太少了,找不到合适的解决方法。 谁能帮我看看是什么...