Search found 245 matches

by alys666
Tue Oct 22, 2019 5:02 pm
Forum: C++ Development
Topic: wxwidget structure understanding
Replies: 2
Views: 39

Re: wxwidget structure understanding

typedef struct Structexample { std::array<long long, 5> longlongarray; sqlite3 *db; std::vector<std::array<long long, 5> > vectorofarray; int sleep; } structexample; here you defined 2 types - Structexample and equal to it - structexample. write just struct TypeName{...}; and TypeName will be a nam...
by alys666
Tue Oct 22, 2019 2:56 pm
Forum: C++ Development
Topic: Focus problem
Replies: 15
Views: 112

Re: Focus problem

people asked you about constructor body, not its declaration
by alys666
Sun Oct 20, 2019 7:28 pm
Forum: C++ Development
Topic: Static Text strings in wxwidgets
Replies: 7
Views: 100

Re: Static Text strings in wxwidgets

may be put static texts in vertical sizers?
at least they won't overlap so.
by alys666
Sun Oct 20, 2019 3:22 pm
Forum: C++ Development
Topic: [OPENGL] Updating vertex buffers in separate thread
Replies: 9
Views: 138

Re: [OPENGL] Updating vertex buffers in separate thread

if you're using an idle event... you just emulated behavior of two coroutines on single core. It works for simple tasks, but to have good reserve for future developement, you need proper multithreading.
then you could use more processor cores, and do your simulations faster.
by alys666
Sat Oct 19, 2019 8:58 am
Forum: C++ Development
Topic: [OPENGL] Updating vertex buffers in separate thread
Replies: 9
Views: 138

Re: [OPENGL] Updating vertex buffers in separate thread

ExitCode Entry() { write explicit "override" in this declaration. You can write wrong signature and de facto not override needed function added: under debugger look if your thread is alive, and really executes it's body? put inside break point and check that break happens few times. if body works, ...
by alys666
Sat Oct 19, 2019 8:53 am
Forum: C++ Development
Topic: [OPENGL] Updating vertex buffers in separate thread
Replies: 9
Views: 138

Re: [OPENGL] Updating vertex buffers in separate thread

since wxWidgets 2.9.5 you do not need to call Create() for thread.
Just run it. Doubt it would help, but....

also check if m_simulate is true on thread start.
by alys666
Sat Oct 19, 2019 8:48 am
Forum: C++ Development
Topic: [OPENGL] Updating vertex buffers in separate thread
Replies: 9
Views: 138

Re: [OPENGL] Updating vertex buffers in separate thread

not sure this function is thread safe(never used it, but thread safety must be explicitly mentioned in documentaion)

Code: Select all

wxLogDebug("Thread Entry()");
by alys666
Sat Oct 19, 2019 12:31 am
Forum: C++ Development
Topic: [OPENGL] Updating vertex buffers in separate thread
Replies: 9
Views: 138

Re: [OPENGL] Updating vertex buffers in separate thread

are you sure you have properly created and started the separate thread?
how the thread body function looks?
by alys666
Fri Oct 18, 2019 3:25 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 239

Re: Application randomly reset and loads new windows

to see another page you must somehow issue notebook->SetSelection(index) added you wrote At the end of this procedure, the application destroys the third frame and reloads the first frame to start a new operation with a new user. you somehow jumped from one frame to another...in SimpleBook you just ...
by alys666
Fri Oct 18, 2019 3:08 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 239

Re: Application randomly reset and loads new windows

https://docs.wxwidgets.org/3.0/classwx_simplebook.html just create wxSimpleBook, create your controls, and insert them into book using AddPage(my_control) to change visibible page use (from base class - wxBookCtrlBase) int SetSelection (size_t page); //here page is page index from 0; it's like norm...
by alys666
Fri Oct 18, 2019 2:11 pm
Forum: C++ Development
Topic: Delete thread with blocking function
Replies: 14
Views: 138

Re: Delete thread with blocking function

cough...cough... it's definitely not linux :) there is nothing in thread list, but addresses only ... 1. if your lib has internal threads and has not explicit functions kinda stop_lib, terminate... you must not try to stop something inside it. there is no big problem if you closed app with still wor...
by alys666
Fri Oct 18, 2019 1:55 pm
Forum: C++ Development
Topic: Delete thread with blocking function
Replies: 14
Views: 138

Re: Delete thread with blocking function

I still get the following message, despite using Kill(): 15:41:27: Debug: 1 threads were not terminated by the application. So I guess I can't do anything until the blocking function returns? Im undertand though, that the thread is terminated, and the heap resources are freed anyway, when the app c...
by alys666
Fri Oct 18, 2019 1:49 pm
Forum: C++ Development
Topic: Delete thread with blocking function
Replies: 14
Views: 138

Re: Delete thread with blocking function

debugger must show all app threads and and their names.
by alys666
Fri Oct 18, 2019 1:34 pm
Forum: C++ Development
Topic: Delete thread with blocking function
Replies: 14
Views: 138

Re: Delete thread with blocking function

I use the following code to terminate the thread: //Delete TCP/IP thread { wxCriticalSectionLocker enter(mbThreadCS); if (mbThreadTCP) { if (mbThreadTCP->Kill() != wxTHREAD_NO_ERROR) wxLogError("Can't delete the thread!"); } } while (1) { { wxCriticalSectionLocker enter(mbThreadCS); if (!mbThreadTC...
by alys666
Fri Oct 18, 2019 1:27 pm
Forum: C++ Development
Topic: Delete thread with blocking function
Replies: 14
Views: 138

Re: Delete thread with blocking function

you could not dream about correct killing thread if there is infinitely blocking function. (that's why properly designed libraries MUST use timeouts). variants 1. look if in your lib exists a timeouted function(often libs implement timeouted and not timeouted variants of the same function) 2. let yo...