Search found 212 matches

by Kvaz1r
Tue Apr 30, 2019 9:14 pm
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 2254

Re: closing wxProgressDialog with a wxThread

thank you! std::future is new to me, have to look into that more. Yeah std::future is pretty simple comparing to wxThread :D. But keep in mind that STL containers haven't thread safe write operations so code from link above is wrong in part of collecting data. I have data files typically 450kB big ...
by Kvaz1r
Tue Apr 30, 2019 7:23 pm
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 51
Views: 2254

Re: closing wxProgressDialog with a wxThread

Btw, if your threads do only monotonous work you can use parallel algorithm for range. It was add into C++17 but it also provided in some libraries (wxWidgets doesn't have this features, though). If you on Windows there is PPL library. But it also could be implement with C++11 like here - https://st...
by Kvaz1r
Tue Apr 30, 2019 2:19 pm
Forum: C++ Development
Topic: Issue in Capturing Screenshot using wxGraphicsContext
Replies: 17
Views: 857

Re: Issue in Capturing Screenshot using wxGraphicsContext

saranya wrote:
Tue Apr 30, 2019 1:12 pm
I have Uploaded the Sample code here
So you just want to save chart from wxPlotCtrl? In this case you can use code from topic - Exporting (saving) graphs from wxPlotCtrl
by Kvaz1r
Tue Apr 30, 2019 6:20 am
Forum: C++ Development
Topic: Issue in Capturing Screenshot using wxGraphicsContext
Replies: 17
Views: 857

Re: Issue in Capturing Screenshot using wxGraphicsContext

I tried to Upload sample Solution(Zip file) containing 30MB which illustrates the Issue. I am unable to attach the file .It is showing an error message (HTTP Error)
You can load it on Github or something. But why it contains 30MB?
by Kvaz1r
Mon Apr 29, 2019 11:48 am
Forum: C++ Development
Topic: unhandled unknown exception in wxThreadInternal::DoThreadStart
Replies: 24
Views: 1138

Re: unhandled unknown exception in wxThreadInternal::DoThreadStart

Yes, this could be a solution like DoubleMax also suggested. I hesitate because that would mean that one thread pool "open files" would use another pool "fill buffer", the buffer being filled with the content of the files. That sounds dangerous, but maybe it is necessary. You can always use only on...
by Kvaz1r
Mon Apr 29, 2019 10:58 am
Forum: C++ Development
Topic: unhandled unknown exception in wxThreadInternal::DoThreadStart
Replies: 24
Views: 1138

Re: unhandled unknown exception in wxThreadInternal::DoThreadStart

So maybe just a problem with my high number of thread creation/deletion? The job I am testing with at the moment: - 438 files (wxMessageQueue using 8 threads) - 3 additional threads per file - takes ~40 seconds so I have 3 * 438 threads created/destroyed, ~33 per second. wxThreads as far I know are...
by Kvaz1r
Mon Apr 29, 2019 9:25 am
Forum: C++ Development
Topic: Checking current locale for wxString
Replies: 3
Views: 224

Re: Checking current locale for wxString

You can get current (default locale) via:

Code: Select all

wxLocale::GetLanguageName(wxLocale::GetSystemLanguage())
List of the supported languages in the documentation.
by Kvaz1r
Fri Apr 26, 2019 9:52 am
Forum: C++ Development
Topic: [wxMSW][wx3.0.3] Drawing text over bitmap
Replies: 5
Views: 374

Re: [wxMSW][wx3.0.3] Drawing text over bitmap

It seems as a known problem. What about workaround way from this SO answer on similar question:
How to draw non-transparent text on an icon (not bitmap) using wxpython?
by Kvaz1r
Thu Apr 25, 2019 1:55 pm
Forum: C++ Development
Topic: Issue in Capturing Screenshot using wxGraphicsContext
Replies: 17
Views: 857

Re: Issue in Capturing Screenshot using wxGraphicsContext

In this case can you show code where drawing the grid and the curve i.e. where the difference? The code above looks OK if the issue is really not in OpenGL.
by Kvaz1r
Thu Apr 25, 2019 11:52 am
Forum: C++ Development
Topic: Issue in Capturing Screenshot using wxGraphicsContext
Replies: 17
Views: 857

Re: Issue in Capturing Screenshot using wxGraphicsContext

I think with wxMemoryDC it would be much more straightforward. Just assosiate your xMemoryDC object with wxGraphicsContext and draw anyrhing you want:

Code: Select all

    wxGraphicsContext* gc = wxGraphicsContext::Create(mdc);//mds is  wxMemoryDC object
    if (gc)
    {
        //draw here
        delete gc;
    }
by Kvaz1r
Wed Apr 24, 2019 7:11 pm
Forum: wxWidgets Development (Russian)
Topic: как правильно вернуть из DLL строку
Replies: 8
Views: 1595

Re: как правильно вернуть из DLL строку

Не специалист, но нашел на SO вот такой вопрос:
Is it bad practice to allocate memory in a DLL and give a pointer to it to a client app?

Если подытожить то рекомендуют освобождать память там-же где и выделять.
by Kvaz1r
Tue Apr 23, 2019 6:17 pm
Forum: C++ Development
Topic: I need to modify a control that is in another window. Completely lost
Replies: 5
Views: 372

Re: I need to modify a control that is in another window. Completely lost

What if try this code: FramePasswords->LbTitulo->SetLabel(wxString::FromUTF8("Título:")); But it's always better provide minimal but complete code for reproducing behaviour. Edit: I see that you solved your problem but also recommend read a tutorial about using dialogs in wxWidgets. Dialogs in wxWid...
by Kvaz1r
Mon Apr 22, 2019 6:22 am
Forum: C++ Development
Topic: I need a very simple example to know how to use threads with wxGauge
Replies: 9
Views: 639

Re: I need a very simple example to know how to use threads with wxGauge

while (!TestDestroy()) { wxQueueEvent(m_frame, new wxThreadEvent(wxEVT_PROGRESSBAR_UPDATE)); } The problem is that the "thread_ThreadUpdate" method is executed continuously and the thread doesn't move to the next method "thread_ThreadFinished", Why? Why it should finished? Your operation only check...
by Kvaz1r
Sat Apr 20, 2019 6:36 pm
Forum: C++ Development
Topic: Read access violation when closing my app
Replies: 5
Views: 443

Re: Read access violation when closing my app

Thank you. I hope you give me a page from the documentation which confirms your talking. It's popular question so wxWidgets developers puted answer into special FAQ. Who deletes all the windows I create? All windows and controls in wxWidgets programs are created using new but you shouldn’t use dele...