Search found 61 matches
- Wed Jan 09, 2013 7:42 am
- Forum: wxDev-C++
- Topic: wxDev-C++7.4 sometime not save the changes of the project
- Replies: 1
- Views: 3436
Re: wxDev-C++7.4 sometime not save the changes of the projec
I've had the same problem, but can't say why it happens. My solution, till a better one is suggested, is to have a file that shows exactly how your project tree should look like. This will make it easier to fix. Sometimes the names of some files and folders will get mixed up, and you end up with a n...
- Sun Jan 06, 2013 12:55 pm
- Forum: wxDev-C++
- Topic: Advice for implementing start/stop of free running process?
- Replies: 11
- Views: 10279
Re: Advice for implementing start/stop of free running proce
That looks a lot cleaner than what I ended up with, so I'll study it and implement it if I can. This is how I got it to work: In "class ThreadsFrm : public wxFrame" : made a private variable: wxThread* t; made public function: void setT(wxThread* myThreadPointer); In ThreadsFrm.cpp: void T...
- Sun Jan 06, 2013 12:05 pm
- Forum: wxDev-C++
- Topic: Advice for implementing start/stop of free running process?
- Replies: 11
- Views: 10279
Re: Advice for implementing start/stop of free running proce
Thanks doublemax, I was thinking about that and wondering if it would result in the thread being created (using up memory), before it's needed. But I could just move the MyThread* t = new MyThread(this) out into Frm,
and keep wxThreadError err = t->Create(); in the button event routine?
and keep wxThreadError err = t->Create(); in the button event routine?
- Sun Jan 06, 2013 11:44 am
- Forum: wxDev-C++
- Topic: Advice for implementing start/stop of free running process?
- Replies: 11
- Views: 10279
Re: Advice for implementing start/stop of free running proce
Hi again, today I made my first (test) program that creates a thread. It's function: 1. Press front panel button to start the thread. 2. On entry the thread sends back an event, signalling that it has started 3. Main program sets a flag "Thread running". 4. If you press the button again, a...
- Sat Jan 05, 2013 1:48 pm
- Forum: General Development
- Topic: A useful compiler warning: Single '=' in if statement
- Replies: 2
- Views: 3673
Re: A useful compiler warning: Single '=' in if statement
Thanks doublemax, that worked: (Thanks for the link too)
MingW compiler warning:
74:13 C:\...\Project1Frm.cpp [Warning] suggest parentheses around assignment used as truth value [-Wparentheses]
Code: Select all
void Project1Frm::WxButton1Click(wxCommandEvent& event)
{
int a, b;
if(a = b){}
}
74:13 C:\...\Project1Frm.cpp [Warning] suggest parentheses around assignment used as truth value [-Wparentheses]
- Sat Jan 05, 2013 3:13 am
- Forum: General Development
- Topic: A useful compiler warning: Single '=' in if statement
- Replies: 2
- Views: 3673
A useful compiler warning: Single '=' in if statement
Today I spent a few hours debugging a program. The problem was that I had a single '=' in an if statement condition, instead of '=='. It would be great if the compiler issued a warning in this case, maybe as an option that idiots could turn on :P Is it ever useful to have a single equals sign in an ...
- Thu Jan 03, 2013 12:10 pm
- Forum: C++ Development
- Topic: Unable to left shift 'unsigned long' by 16
- Replies: 2
- Views: 1532
Re: Unable to left shift 'unsigned long' by 16
Thanks Radek, it was the 'h' in my format statement, removed it and now it prints the full number. I can't remember where I picked that up from.
- Thu Jan 03, 2013 3:25 am
- Forum: C++ Development
- Topic: Unable to left shift 'unsigned long' by 16
- Replies: 2
- Views: 1532
Unable to left shift 'unsigned long' by 16
Hello, I've been battling with this for a couple of hours now. I have an 'unsigned long' variable that needs to be left shifted by 16, but the answer comes out to 0 every time. unsigned long ulTemp; unsigned char ucTemp, ucSIDH; . . . ulTemp = (unsigned long)(ucTemp + ucSIDH); ulTemp = ulTemp << 16;...
- Thu Dec 27, 2012 10:29 pm
- Forum: wxDev-C++
- Topic: Accuracy of wxStopWatch?
- Replies: 5
- Views: 5666
Re: Accuracy of wxStopWatch?
Thanks Tony, my application doesn't need super precise, or real time, interval measurement. Currently I am just sending a packet out of the USB port, then in a loop: usleep(3ms), check for a response from the external device. In the earlier post, just using usleep in the test program, I could get an...
- Sun Dec 23, 2012 8:08 pm
- Forum: wxDev-C++
- Topic: Advice for implementing start/stop of free running process?
- Replies: 11
- Views: 10279
Re: Advice for implementing start/stop of free running proce
Last night I started reading about how to set up threads. That would be best, so it's time to put this button thing aside for now, and move on to do what needs to be done. Then worry about the darn button and threads.
thanks doublemax, and Tony.
Walter
thanks doublemax, and Tony.
Walter
- Sun Dec 23, 2012 7:53 pm
- Forum: wxDev-C++
- Topic: Advice for implementing start/stop of free running process?
- Replies: 11
- Views: 10279
Re: Advice for implementing start/stop of free running proce
Thanks doublemax, now those instructions are not causing a compiler error anymore. I'm having the same trouble with wxApp::FilterEvent, but I think it's a matter of where this function can run (not in an event servicing routine?). I found this example on how to use Filter Event , and am about to try...
- Sun Dec 23, 2012 6:12 am
- Forum: wxDev-C++
- Topic: Advice for implementing start/stop of free running process?
- Replies: 11
- Views: 10279
Re: Advice for implementing start/stop of free running proce
Thanks Tony, I've been experimenting all this time (since my last post!). I also found another function I wanted to try, wxApp.Pending . I'm doing something wrong when calling any function of the form wxApp. I assumed that wxApp is the name of my application : class PicCanBrdFrmApp : public wxApp { ...
- Sat Dec 22, 2012 4:15 pm
- Forum: wxDev-C++
- Topic: Advice for implementing start/stop of free running process?
- Replies: 11
- Views: 10279
Advice for implementing start/stop of free running process?
Hi, I couldn't get the subject description very precise. Here's what I need to do: When I press a wxButton, the event starts code to continuously monitor a CAN bus (or say any process). However, I would like to stop the monitoring code when the same wxButton is pressed again. I assume that once the ...
- Fri Dec 21, 2012 4:37 am
- Forum: wxDev-C++
- Topic: Accuracy of wxStopWatch?
- Replies: 5
- Views: 5666
Re: Accuracy of wxStopWatch?
Thanks doublemax, I'll follow that lead for some more info. I guess usleep() must use the same API.
- Fri Dec 21, 2012 2:21 am
- Forum: wxDev-C++
- Topic: Accuracy of wxStopWatch?
- Replies: 5
- Views: 5666
Accuracy of wxStopWatch?
Hi, today I was looking for a way of generating pauses with an accuracy of a few ms. I wrote a small program to compare the performance of wxTimer and usleep(). I passed each function the same ms value, then used wxStopWatch to measure the time intervals. Here's a shot of the front panel: http://i45...