This code should fix the bug that was associated with the for-each loop. I've confirmed it works on Windows but not that it works on Mac (I don't have a Mac to test on.) It should work on Mac as long as dict_pKeyValues is what stores the keys for the dictionary on the Mac. If that is not the correct data structure that holds the keys, it should work when the correct one is substituted.
This code should fix the bug that was associated with the for-each loop. I've confirmed it works on Windows but not that it works on Mac (I don't have a Mac to test on.) It should work on Mac as long as dict_pKeyValues is what stores the keys for the dictionary on the Mac. If that is not the correct data structure that holds the keys, it should work when the correct one is substituted.