03-09-2012 04:16 AM
Hi,
I have un update problem on a numeric slide. I use this slide in a loading window.
The slide looks fine form 0 to 100 but when its return to 0 i see a dark line at the correct position but the slide is fully fill:
I use this code:
static int CVICALLBACK Banner_TH (void *functionData) { int i =0; do { if (i>=100) { i = 0; } else { i=i+1; } SetCtrlVal (panel_Handle,LOAD_PAN_WAIT ,i ); ProcessDrawEvents (); Delay(0.1); } while(!_stopThread); HidePanel( panel_Handle ); return 0; }
and this one to call:
SetCtrlVal (panel_Handle,LOAD_PAN_WAIT ,0 ); //Start Banner in thread _stopThread = 0; CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, Banner_TH, NULL,&_threadID );
If someone have an idea?
Thanks
Solved! Go to Solution.
03-09-2012 05:37 AM
I can only think to some problem when updating a control in a thread that dows not own the panel where the control lies.
You could PostDeferredCall in the thread a function that updates the control, passing its value in function callbackData: the deferred callback is executed in the main thread, which is the one that normally handles the user interface unless you have loaded the panel in the separate thread (which you are not doing).
03-12-2012 04:39 AM
OK thanks, i will try the PostDeferredCall.
03-12-2012 10:27 AM - edited 03-12-2012 10:28 AM
I solve the problem by loading the panel in the thread which update the control. So I update a control owned by a panel in the same thread.
Thank you for tell me the origin of this problem