Hello RaduBogdan,
The appropriate way to exit the RunUserInterface function is to call QuitUserInterface. If you're not closing your application without pressing the Close button, and thus without calling QuitUserInterface, I'm assuming you are closing the application by pressing the Red X button at the top right corner. You should create a panel callback that handles the EVENT_CLOSE event that is thrown when you press this button.
int CVICALLBACK panelCB (int panel, int event, void *callbackData,
int eventData1, int eventData2)
{
if (event == EVENT_CLOSE)
QuitUserInterface (0);
return 0;
}
Then you're guaranteed to call QuitUserInterface in both scenarios.
Thanks.
Wendy L
LabWindows/CVI Developer Newsletter