LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

XML, how to wait for

My program needs to load data from an XML file before it can run, this takes around 10secs. If the user clicks on a button while this is happening I get 

Function FileSelectPopupEx: (return value == -180 [0xffffff4c]). The dialog cannot be displayed in a thread whose concurrency model is multithread apartment (MTA)

 

To prevent this I have added a panel telling to wait, and disable buttons.

I have put the HidePanel in the end of the readXML function. I am not knowingly using separate threads.

But when run the panel only flashes on the screen briefly  and the button is enabled before the XML load is complete.

 

How do I detect the XML load is completed?

0 Kudos
Message 1 of 2
(691 Views)

Do the loading before you launch the threads ? Lock the other threads while the loading is ongoing ?

0 Kudos
Message 2 of 2
(633 Views)