Search found 75 matches

by Ksawery
Mon Aug 05, 2019 1:21 pm
Forum: C++ Development
Topic: Set Icon
Replies: 6
Views: 689

Set Icon

Hello, I'd like to setup an icon for my wxWidgets application, so that it appears both on the .exe file, as well as in the taskbar and top-left corner of each application window. What would be the best way to achieve this? I've searched for a solution for a while now, and I came across posts referri...
by Ksawery
Mon Jul 29, 2019 3:47 pm
Forum: C++ Development
Topic: wxButton - disable not working
Replies: 2
Views: 295

Re: wxButton - disable not working

Hi, thanks for taking a look at my code. You are right, I totally forgot about that. I now moved the GUI code outside the thread and I think it's working correctly now.

Many thanks,
Ksawery
by Ksawery
Mon Jul 29, 2019 2:38 pm
Forum: C++ Development
Topic: wxButton - disable not working
Replies: 2
Views: 295

wxButton - disable not working

Hello, I currently have two buttons in my main window, which become temporarily disabled (for 2 seconds) when pressed. However sometimes (but not always) when I press the buttons, they first "flash" (which I assume is the "button pressed" animation), and don't become disabled . Is this a bug? I'm no...
by Ksawery
Sun Jul 28, 2019 1:45 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 731

Re: Infinite loop running in the background

That makes sense, it now works, thank you!
by Ksawery
Sun Jul 28, 2019 12:00 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 731

Re: Infinite loop running in the background

Thank you for your quick reply, that helped solve the problem of the application hanging on wxCriticalSectionLocker lock(m_dataCS) , however I'm still unable to close the window (the window remains where it was and I have to manually terminate the application in the debugger). I'm still not sure why...
by Ksawery
Fri Jul 26, 2019 2:26 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 731

Re: Infinite loop running in the background

Thank you, I will try to use wxThreadHelper for now, but I will also take a look at the code you provided :) Just for comparison, here is a very simple complete example using just wxThread, where instead of Sleep()ing, one could communicate with the device #include <wx/wx.h> #include <wx/thread.h> c...
by Ksawery
Fri Jul 26, 2019 2:06 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 731

Re: Infinite loop running in the background

Thank you, I used the code template provided, and wxThreadHelper works pretty well. The only problem I have is that when I attempt to close the frame (which is my main GUI window), the application hangs and the window doesn't close. What's the issue here, do I need to call some code from the destruc...
by Ksawery
Fri Jul 26, 2019 12:26 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 731

Re: Infinite loop running in the background

Thank you, I'll give it a read.
by Ksawery
Fri Jul 26, 2019 11:40 am
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 731

Infinite loop running in the background

I'm building a GUI which will use data continuously received via a serial port. I'd like to setup a loop that will always run in the background, poll for new data (via a Modbus protocol) and update the text in the main GUI window. What would be the best way to implement this? Do I need to create a n...
by Ksawery
Fri Jul 26, 2019 10:03 am
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 1280

Re: Using libmodbus with wxWidgets

Ok, I re-compiled libmodbus in 32-bits, instead of re-compiling wxWidgets in 64-bits, and... http://www.quickmeme.com/img/14/14b5cf9333e7faf072cc4b453793df731bd73de847eaf650ecc6d470b83a18ce.jpg So it was 32/64 bit compatibility after all. I still needed to ensure the order of headers was correct and...
by Ksawery
Fri Jul 26, 2019 9:34 am
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 1280

Re: Using libmodbus with wxWidgets

Thanks, I'll recompile wxWidgets to ensure its 64-bits and test the application again.

Regards,
Ksawery
by Ksawery
Fri Jul 26, 2019 9:29 am
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 1280

Re: Using libmodbus with wxWidgets

Could it be that the 64-bit compiled library may be in conflict with the 32-bit wxWidgets library? Now i'm not sure which version of wxWidgets I built, perhaps that's the issue here.
by Ksawery
Fri Jul 26, 2019 9:09 am
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 1280

Re: Using libmodbus with wxWidgets

Thanks for your reply. I built the library myself, using the instructions provided in the readme, at the following repository: https://github.com/stephane/libmodbus I built the library in Visual Studio 2019, Windows x64. I then linked the source/header and .dll files into the wxWidgets project, in t...
by Ksawery
Thu Jul 25, 2019 3:34 pm
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 1280

Re: Using libmodbus with wxWidgets

Thank you. Unfortunately changing the order of includes made things worse. I managed to get the application to run by suppressing the error/warnings using: #pragma warning(disable:4996) However I'm unable to call the library functions: /* Initialize MODBUS */ modbus_t* ctx; ctx = modbus_new_rtu("\\\...
by Ksawery
Thu Jul 25, 2019 12:45 pm
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 1280

Using libmodbus with wxWidgets

Hello, I'm starting to learn wxWidgets through online tutorials, and so far I have successfully created a very basic GUI in Visual Studio 2019. I was planning on using wxWidgets to create a GUI for a Modbus RTU RS-232 Master application, which will communicate over the serial line with a Modbus slav...