I have a function callback from a C++ DLL which is being used in a VBA macro. The callback works fine when I just echo the parameters to the function to the screen using the MsgBox function. It fails, however, when I try to use the callback function to update the textboxes on the main userform. From research, I've determined that this is because a background thread cannot up date the UI thread. Even though the callback function is in the Forms procedures, it is still run in it's own thread. (I don't think this can be changed.)
I've tried creating a second function in the form that is called when the callback function fires as well as moving that function to a separate module and neither method works. (By works I mean that the program doesn't crash.)
How do I modify the UI elements from a function that is running in another thread?
I read up on the Invoke command, but it doesn't appear to be available for this version of VBA.
My program isn't otherwise multithreaded, and I don't want to add the complexity if I don't have to. (I have to pass this project to a client of unknown programming knowledge or abilities...)
Thank you!
I've tried creating a second function in the form that is called when the callback function fires as well as moving that function to a separate module and neither method works. (By works I mean that the program doesn't crash.)
How do I modify the UI elements from a function that is running in another thread?
I read up on the Invoke command, but it doesn't appear to be available for this version of VBA.
My program isn't otherwise multithreaded, and I don't want to add the complexity if I don't have to. (I have to pass this project to a client of unknown programming knowledge or abilities...)
Thank you!