今天还是修改原先VB6处理的程序,在错误处理方面需要一些改进,弄了一个ErrorHelper的类,还是有点用处的,存到这里吧.

VB6中的ErrorHelperOption Explicit
VB6中的ErrorHelper
VB6中的ErrorHelper
Private m_Continue As Boolean
VB6中的ErrorHelper
VB6中的ErrorHelper
Private m_MessageString As String
VB6中的ErrorHelper
VB6中的ErrorHelper
Private m_DisplayDetailErrInfo As Boolean
VB6中的ErrorHelper
VB6中的ErrorHelper
Public Event onError()
VB6中的ErrorHelper
VB6中的ErrorHelper
'解析错误对象
VB6中的ErrorHelper'
DefaultMessageString:显示的提示消息,如果为空则显示缺省消息
VB6中的ErrorHelper'
frm:处理卸载窗体,可选
End Sub

测试代码:
VB6中的ErrorHelperDim WithEvents eh As ErrorHelper
VB6中的ErrorHelper

通过这些代码可以节约一些重复代码的数量,作为一个小的底层错误处理机制应该还可以.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-02-18
猜你喜欢
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-01-09
  • 2021-11-24
相关资源
相似解决方案