From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

RunUserInterface() is apparently returning before callback function even executes

Solved!
Go to solution

Hello,

 

I am developing a DLL and recently tested a simple test case by calling one of the DLL functions from TestStand. The function is simple. It does the following:

 

Loads a particular panel from my UIR file (for entering SN, etc..) - LoadPanelEx

Displays that panel - DisplayPanel()

calls RunUserInterface() - to wait for callback function to fire

 

Now, I have a separate callback function that fires when someone selects the "OK" button on that panel. It does some data collection from the panel controls and then calls QuitUserInterface(). 

 

The bahaviour I'm seeing, is that RunUserInterface just immediately returns without waiting for the flag from QuitUserInterface which is in my callback function. According to the CVI documentation, RunUserInterface will wait until you call QuitUserInterface before returning. In my case, it just returns immediately and the panel just hangs there. TestStand just finishes executing because as far as it's concerned, the function it called in the DLL returned successfully. 

 

Not sure what I'm doing wrong, any tips?

 

0 Kudos
Message 1 of 3
(710 Views)

any information from the return value?

status = RunUserInterface ();

 

you could verify that RunUserInterface returns because of QuitUserInterface by passing a return code to QuitUserInterface (int returnCode);

0 Kudos
Message 2 of 3
(662 Views)
Solution
Accepted by topic author TestEngineer11

I figured out what the issue was. The call to QuitUserInterface in one of my callback functions was placed in such a way that it never executed. Silly mistake. 

0 Kudos
Message 3 of 3
(651 Views)