Another refactor request for input.
In a project from 2012, we open 2 or more windows depending on the users’ decisions to allow the same number of tasks to run on different data. This was always done via a thread that opened each window and then allowed that window’s process to run in conjunction with the other windows’ tasks. Under RS 2011r1 with a Carbon compile this worked properly for a number of versions and 100’s of users.
Jump forward to 2017 and 2 of the project’s larger installations are moving to 10.12-based Mac Minis and iMacs and we need to update the project to run in Cocoa as well as resolve the “ThreadAccessingUIExcetion” that the above description brings with it.
In my refactor plans, I changed the thread calls to use timers to open the separate windows as needed. However, it seems that no matter what order or how many wait loops I place before each new window.open call, one one of the windows opens and executes its take (the correct one does open, so the logic is passing the correct arguments to the correct window.
The other windows never open and debugging doesn’t answer the question as to what is happening.
The basic code for the process handler is:
For x = 0 To RunTask.Ubound tmTaskWindow(x).Mode = 1 Next
The tmTaskWindow timer is an array of timers allowing for up to 8 tasks to be started.