04-14-2008 05:59 AM
04-17-2008 09:00 AM
Ruan,
I have taken a look at your program and have some information. It looks as though the thread we create with our data loop seems to block the rest of the program until the mouse events occur. Unfortunately I haven't been able to force the code to unblock or allow system events so that the graph will properly update (calling the timer tick function).
I was able to find a workaround but it changes the flow of control in the program so it might not be a complete solution. I created a 'Stop' button on the UIR panel and generated its callback function into which I put the following two lines of code:
CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, threadFunctionId1);
SetCtrlAttribute (panel0, PANEL_TIMER, ATTR_ENABLED, 0);
I also then commented out the CmtWaitForThreadPoolFunctionCompletion function in the Run button callback. This program works fine, it will run when you click Run and stop whenuntil you click the stop button. Again, this is changing the flow of the program you had so it may not be a desireable solution but I wanted you to know that it may be a workaround for the time being if necessary. I will continue to research the problem with the original code and let you know when I find something.
04-18-2008 05:31 AM
04-18-2008 11:34 AM
04-21-2008 01:41 AM
Thanks alot,
i'll try it out and see what works best for me
Thanks
Ruan