This question came to mind when I asked to put a progress bar on a long running process where开发者_开发技巧 the process has no concept of a user interface. In fact, the process is being written into a library to be pulled in from other applications. However, how do I provide a way for a WinForm to subscribe to the process to update as the process gets executed? I've open this question from both VBA/VB6 and .Net because its part of the gamut for UI development. It's also worth mentioning that these are subroutines and not classes that are running the methods, so event raising appears to be out of the question. Should I expose incrementing variables as public? Thanks in advance.
Adam: Should we be eating of forbidden fruit?
Eve: Yes. I think so. Go ahead Adam.
Serpant: Stop with the chit-chat and expose those variables already....
God: Noooooooooooo!!!
There's now need to expose your variables. How about writing a ProcessCompletionStatus
subroutine which looks at those incrementing variables and tells how much has been done?
精彩评论