02-21-2022 11:17 AM
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?
03-02-2022 07:28 AM
Do the loading before you launch the threads ? Lock the other threads while the loading is ongoing ?