开发者

How do I loosely couple a process to a user interface for VBA and/or .Net?

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜