I was reading a thread from a few years ago that talked about an issue I am having now, I have a WPF application that has a long running process iterating files, I would prefer to run this process as a Task in a background thread, either by using backgroundworker or async, but it appears that Microsation does not allow you to load a DGN file from non-application thread.
Is there a way to update the UI and keep it responsive during this process? In VBA there's DoEvents, it doesn't release the UI but it does allow it to be refreshed/repainted. Any options on this?
Viktor_Kulik said:In VBA there's DoEvents, it doesn't release the UI
To supplement Jan's comprehensive answer, DoEvents has nothing to do with multi-threading. It was invented in the days of Visual Basic (VB) in the late 20th century.
DoEvents
VB is a Windows app. and uses the Win32 API. In those early days of Windows, Icons, Mice Pointer (WIMP) development, a running app. would block windows updates. There was no option to spawn a process, so Microsoft invented DoEvents. DoEvents performs message-pumping, which processes all Windows messages currently in the message queue. That enables other windows to update themselves.
You can do the same with C++ using mdlSystem_pumpMessages and mdlSystem_pumpMessagesEx.
mdlSystem_pumpMessages
mdlSystem_pumpMessagesEx
Regards, Jon Summers LA Solutions