04-14-2011 06:14 AM
I have write a programm, to write a file format in an other.
The files are so big that the programm work very long. So I made a text message that show the program is still working.
In the beginning was working well. But now the text messages is no longer displayed.
I have no idea what the problem is.
some code:
int CVICALLBACK ReadCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int iConfiguration;
switch (event)
{
case EVENT_COMMIT:
SetCtrlAttribute (panelHandle, PANEL_TXTMSG_Load, ATTR_VISIBLE, 1);
GetCtrlVal (panelHandle, PANEL_Dataset_Conf, &iConfiguration);
Function_Worker(iConfiguration);
SetCtrlAttribute (panelHandle, PANEL_TXTMSG_Load, ATTR_VISIBLE, 0);
break;
case EVENT_LEFT_CLICK:
break;
}
return 0;
}
The function_worker does made nothing with the GUI but it works with a DLL. Is this a problem?
Do you have any ideas?
Solved! Go to Solution.
04-14-2011 06:29 AM - edited 04-14-2011 06:35 AM
Hi,
When your program executes in a callback function or in code that does not call RunUserInterface or GetUserEvent, LabWindows/CVI does not process user interface events. Functions that are overly time-consuming can "lock out" user interface events. To allow LabWindows/CVI to process events, call ProcessDrawEvents.
04-14-2011 06:48 AM
Somewhat more elaborate I'd suggest to modify your code as follows:
case EVENT_COMMIT:
SetCtrlAttribute (panelHandle, PANEL_TXTMSG_Load, ATTR_VISIBLE, 1);
ProcessDrawEvents ();
GetCtrlVal (panelHandle, PANEL_Dataset_Conf, &iConfiguration);
Function_Worker(iConfiguration);
SetCtrlAttribute (panelHandle, PANEL_TXTMSG_Load, ATTR_VISIBLE, 0);
break;
04-14-2011 07:33 AM
Thank you very much. With "ProcessDrawEvents ();" it works perfectly.