Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/vb6/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb6 Sub传递用户控件,因为对象在编译程序中崩溃,而不是在IDE中_Vb6_Controls_Activex_Executable - Fatal编程技术网

Vb6 Sub传递用户控件,因为对象在编译程序中崩溃,而不是在IDE中

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

我有一个传递给用户控件(在项目中定义)作为其参数之一的函数。当在IDE中运行时,它工作得很好。但是,在运行编译后的版本时,它通常会显示意外的(尽管有变化)行为-最常见的观察到的(也是有问题的)是短暂的挂起,然后是桌面崩溃(没有错误消息)。(始终使用Windows 7)

粗略地说,代码如下所示:

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

我想你必须要比“意外(尽管多种多样)的行为”更具体。对不起,我想我已经把它格式化得更好了。