Search found 374 matches

by mael15
Fri Apr 26, 2019 11:07 am
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

The wxProgressDialog still makes problems. It works fine when you start it the first time, but the second time there is no progress shown. Update(int) does not seem to return until the dialog is closed?!? #include <wx/msgqueue.h> #include <wx/thread.h> class MyJob { public: MyJob() {} MyJob(int jobC...
by mael15
Fri Apr 26, 2019 9:17 am
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

I will definitely try this very soon when I find the time and make a minimal working example of this. So here it is, works fine! EDIT: see more recent code in later post Do you see any potential problems in it? It is a bit weird that there is no method to get the number of jobs in the wxMessageQueu...
by mael15
Thu Apr 25, 2019 10:02 am
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

but if you want to create your own implementation of jobs dispatching between workers, you must use exactly the same algorithm, as wxMessageQueue uses. look in its code. wow, thank you very much for taking the time! I will definitely try this very soon when I find the time and make a minimal workin...
by mael15
Thu Apr 25, 2019 10:00 am
Forum: C++ Development
Topic: unhandled unknown exception in wxThreadInternal::DoThreadStart
Replies: 24
Views: 639

unhandled unknown exception in wxThreadInternal::DoThreadStart

I have multiple threads working on a repetitive job with hundrets of files: - open a file - read binary and xml content - close file - make calculations on binary content sometimes, after hundreds of iterations working fine, I get a crash with a message "Caught unhandled unknown exception, terminati...
by mael15
Tue Apr 23, 2019 8:50 am
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

MyProgressDlg(wxWindow *par) : wxProgressDialog(wxT("thread progress test"), wxT("message"), 100, par, wxPD_CAN_ABORT | wxPD_APP_MODAL | wxPD_AUTO_HIDE) { thr = new MyThread(this); Connect(wxEVT_THREAD, wxThreadEventHandler(MyProgressDlg::onThreadEvent)); thr->Run(); } do not know if this your code...
by mael15
Tue Apr 23, 2019 8:48 am
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

Hi. you definitely need to use not wxString, but const wxString & - so give as parameter a constant reference to object. else you are making excessive copies you do not needed. okay, cool, thank you! i have to admit that const is one thing I never got used to... const means that object given by ref...
by mael15
Mon Apr 22, 2019 2:37 pm
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

Calling ShowModal() on the progress dialog is definitely wrong. I am still getting into trouble with closing the wxProgressDialog. When I omit the wxPD_AUTO_HIDE style, it freezes here: wxbase31ud_vc_x64_custom.dll!wxMSWEventLoopBase::GetNextMessageTimeout(tagMSG * msg, unsigned long timeout) Zeile...
by mael15
Mon Apr 22, 2019 11:38 am
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

alys666 wrote:
Mon Apr 22, 2019 9:48 am
Hi. you definitely need to use not wxString, but const wxString & - so give as parameter a constant reference to object. else you are making excessive copies you do not needed.
okay, cool, thank you! i have to admit that const is one thing I never got used to...
by mael15
Fri Apr 19, 2019 10:18 am
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

yes, it works fine the way it is described in the link, thank you! But only if the aforementioned wxPD_AUTO_HIDE is set, otherwise it stays visible showing "Done."
by mael15
Thu Apr 18, 2019 3:46 pm
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

okay, this is my minimal example: sorry that there is a lot of overhead, it was necessary to use my custom ThreadWithJobQueue template. you can probably ignore this, the mentioned problem shows. app.h #pragma once #include <wx/frame.h> #include <wx/app.h> #include <wx/progdlg.h> #include <unordered_...
by mael15
Thu Apr 18, 2019 2:31 pm
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

I don't know if it's the same issue, but i remember to have had problems with the wxPD_AUTO_HIDE style, so i never used it. The dialog gets destroyed anyway when it goes out of scope. I would have never thought of that. It changes things but gives me another error: wxbase31ud_vc_x64_custom.dll!DoSh...
by mael15
Thu Apr 18, 2019 11:13 am
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

If you'd use wxGenericProgressDialog, these things would probably work. Hmmmm, it actually does work in a minimal example, only not in my app although I checked for differences between them. The dialog reaches its maximum value and starts closing, but it does not finish? wxmsw31ud_core_vc_x64_custo...
by mael15
Mon Apr 15, 2019 2:17 pm
Forum: C++ Development
Topic: determine number of cpu cores
Replies: 9
Views: 342

Re: determine number of cpu cores

I made a minimal example to test using multiple threads on my development system (stronger than the later working systems) with an Intel i7-4770K having 4 cores and a logical cpu count of 8 (values from ASTRA32). I was a bit surprised by the measured time: threads | time (ms) ----------------- 1 | 1...
by mael15
Fri Apr 12, 2019 9:26 am
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

under Window is just a wrapper around a native dialog. It doesn't behave like a "normal" wxDialog. If you'd use wxGenericProgressDialog, these things would probably work. Aaaaah, so this explains why the inherited functions do not apply? https://docs.wxwidgets.org/3.1.0/classwx_progress_dialog.html...
by mael15
Thu Apr 11, 2019 2:22 pm
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 1261

Re: closing wxProgressDialog with a wxThread

i think my problem is stuck between wxThread and wxProgressDialog, so the sample does not seem to help. It probably would be solved if I could get some custom code to be executed as soon as the wxProgressDialog closes itself. Is that possible? my minimal example demonstrates the problem. let it run ...