Vb6 Sub传递用户控件,因为对象在编译程序中崩溃,而不是在IDE中
我有一个传递给用户控件(在项目中定义)作为其参数之一的函数。当在IDE中运行时,它工作得很好。但是,在运行编译后的版本时,它通常会显示意外的(尽管有变化)行为-最常见的观察到的(也是有问题的)是短暂的挂起,然后是桌面崩溃(没有错误消息)。(始终使用Windows 7) 粗略地说,代码如下所示:Vb6 Sub传递用户控件,因为对象在编译程序中崩溃,而不是在IDE中,vb6,controls,activex,executable,Vb6,Controls,Activex,Executable,我有一个传递给用户控件(在项目中定义)作为其参数之一的函数。当在IDE中运行时,它工作得很好。但是,在运行编译后的版本时,它通常会显示意外的(尽管有变化)行为-最常见的观察到的(也是有问题的)是短暂的挂起,然后是桌面崩溃(没有错误消息)。(始终使用Windows 7) 粗略地说,代码如下所示: Public Sub DoStuffToControl(ByRef ThisUserControl As MyUserControl) Dim refreshState As Boolean
Public Sub DoStuffToControl(ByRef ThisUserControl As MyUserControl)
Dim refreshState As Boolean
Dim I As Long
refreshState = ThisUserControl.Redraw
ThisUserControl.Redraw = False
for I = 0 to 1000
'Do something to the control
next I
ThisUserControl.Refresh
ThisUserCOntrol.Redraw = refreshState
End Sub
我想你必须要比“意外(尽管多种多样)的行为”更具体。对不起,我想我已经把它格式化得更好了。