vb如何判断文件是否已加载成功
1、部分代码如下:
If Client_Controls_Loaded(Index) = True Then
Client_Controls_Loaded(Index) = False
Unload WskClient(Index)
End If
Load WskClient(Index)
Client_Controls_Loaded(Index) = True

2、Private Sub Command1_Click()
On Error Resume Next
Load Winsock1(1)
If Err.Number = 360 Then MsgBox "对象已存在", , "错误"
On Error GoTo 0
End Sub
注意INDEX

3、在没有执行Command1_Click()之前执行了Command2_Click(),但得到的消息却是“已加载”,这是为何呢?
Private Sub Command1_Click()
Load Winsock1(1)
End Sub
Private Sub Command2_Click()
If Not Me.Winsock1(1) Is Nothing Then
MsgBox "已加载"
Else
MsgBox "没有加载"
End If
End Sub

4、Private Sub Winsock1_Error(Index As Integer, ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)

5、Private Sub Command2_Click()
If Not Me.Winsock1(1) Is Nothing Then
MsgBox "已加载"


6、 Else
Load Winsock1(1)
End If
End Sub

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:162
阅读量:90
阅读量:115
阅读量:43
阅读量:66