Search found 242 matches

by Natulux
Tue Feb 11, 2020 3:34 pm
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

Re: multi threaded app

Unfortunately I also got a crash in the above described OnIdle and I still dont know what causes that. bool wxSocketBase::Destroy( ) Destroys the socket safely. Use this function instead of the delete operator, since otherwise socket events could reach the application even after the socket has been...
by Natulux
Mon Feb 10, 2020 8:10 am
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

Re: multi threaded app

Hi, What is the backtrace at the time of the crash? It actually is the same every run. The server can run for several thousand queries or just a few, but eventually it crashes here everytime: Base.exe!wxAppConsoleBase::DeletePendingObjects() Line 571 + 0x4 bytes C++ Base.exe!wxAppConsoleBase::Proce...
by Natulux
Fri Feb 07, 2020 10:01 am
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

Re: multi threaded app

Thanks for all the good hints. In my testing, I receive queries from 40 curl consoles and pass the sockets to 10 worker queries via wxMessageQueue. This actually works. At least for several minutes, because then it crashed again with access violation in the OnIdle event in the mainloop. It also cras...
by Natulux
Thu Feb 06, 2020 1:30 pm
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

Re: multi threaded app

I found wxQueueEvent which is supposed to thread safe propagate events between threads. I'm not sure if this is a misunderstanding or just bad wording: Events are always handled in the main thread. If you use wxQueueEvent, the direction is always from any thread (usually a worker thread) to the mai...
by Natulux
Thu Feb 06, 2020 10:01 am
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

Re: multi threaded app

Apart from the above: I found wxQueueEvent which is supposed to thread safe propagate events between threads. Unfortunately it needs the thread object as a parameter. If I used just one worker thread I could pass the event to it with wxQueueEvent. But I want more than just one worker thread. In that...
by Natulux
Thu Feb 06, 2020 8:44 am
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

Re: multi threaded app

Hi, Also I think you should use SQLite in MT mode. I don't remember the flag name on top of my head though... Thank you. Doublemax posted the flags in the article he linked above: #define WXSQLITE_OPEN_READONLY 0x00000001 #define WXSQLITE_OPEN_READWRITE 0x00000002 #define WXSQLITE_OPEN_CREATE 0x000...
by Natulux
Thu Feb 06, 2020 8:32 am
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

Re: multi threaded app

Did you see this: When using wxSocket from multiple threads, even implicitly (e.g. by using wxFTP or wxHTTP in another thread) you must initialize the sockets from the main thread by calling Initialize() before creating the other ones. Im not sure I understand that correctly but I have not called I...
by Natulux
Wed Feb 05, 2020 7:42 am
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

Re: multi threaded app

One of the things I am worried about is the sqlite database object. This might be of interest for you: https://forums.wxwidgets.org/viewtopic.php?f=34&t=46048 Thank you, that is indeed quite helpfull. We tested by simulating at least one query per second to a single threaded app and db and a mu...
by Natulux
Mon Feb 03, 2020 9:30 am
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

Re: multi threaded app

One of the things I am worried about is the sqlite database object. So maybe I could just allow the usage of wxGetApp but encourage to use some objects via an intermediate function, that uses a mutex. That is quite error prone, because the usage of my intermediate function is only optional, but I ca...
by Natulux
Mon Feb 03, 2020 9:12 am
Forum: C++ Development
Topic: multi threaded app
Replies: 17
Views: 2650

multi threaded app

Hey So far I used a lot of events to have a "sorts of multi threaded" server and app. But because of data big enough to block the main thread for several seconds, I try to change the socket server to use wxThread for each request. But here's the thing: The request handlers use wxDECLARE_DY...
by Natulux
Wed Jan 29, 2020 1:58 pm
Forum: Compiler / Linking / IDE Related
Topic: using wxWidgets in static library
Replies: 1
Views: 747

Re: using wxWidgets in static library

Ah, nevermind. I used a non functional wxWidgets compilation.

The missing flags are in found in lib\vc_lib\mswu\wx\setup.h
I needed to set the additional include path (lib\vc_lib\mswu) which I usually have in my linker settings.
by Natulux
Wed Jan 29, 2020 1:39 pm
Forum: Compiler / Linking / IDE Related
Topic: using wxWidgets in static library
Replies: 1
Views: 747

using wxWidgets in static library

Hey I created a class which needs a bunch of files and I want to use that class accross multiple wxWidgets projects. I never created a (static) library myself, but I thought it might be of good use here because I could just copy (or link to) one precompiled lib (and its include) to use that class. P...
by Natulux
Thu Jan 09, 2020 9:40 am
Forum: C++ Development
Topic: WebSocket Server
Replies: 3
Views: 2504

Re: WebSocket Server

Libwebsocket might be more powerfull, but it lets you know every now and then that it is made by and for linux users and I had a lot of frustration trying to use it on my windows machine in a C++ project. If you are searching for a websocket lib and you are using C++ you might consider using "S...
by Natulux
Wed Jan 08, 2020 3:45 pm
Forum: C++ Development
Topic: Implementing "Append", "Insert" and "Remove"
Replies: 10
Views: 1124

Re: Implementing "Append", "Insert" and "Remove"

Second, I tried to bind mouse events to the type combo box and it appears not to work (on Windows). It does working on GTK. I think I had a familiar problem, when I created a screenshot tool. I wanted to draw rectangles on a transparent frame, but I couldn't catch mouse events on it. Eventually I e...
by Natulux
Wed Jan 08, 2020 3:08 pm
Forum: Platform Related Issues
Topic: directory and file permission
Replies: 1
Views: 959

Re: directory and file permission

I think I solved the problem. I re-set the user permission for the root directory (and thus for all sub directories and files, now and in future) and gave full access. At least all newly created files can now be deleted by wxW, which is good enough for me. I guess some windows security update messed...