非常正确!在我程序中行了循环,而且循环有2个DoEvents 代码类似: Do While Not EOF(SelfTransmitFileNum): DoEvents ... Do While WaitForServerRecieve = True: DoEvents Loop ... Loopto utiao(天下文章): 我是不是 1.在Form_Load中加:exit = false 2. Do While Not EOF(SelfTransmitFileNum) if not exit then DoEvents ... Do While WaitForServerRecieve = True DoEvents Loop ... Loop
2.Do While Not EOF(SelfTransmitFileNum) if not exit then DoEvents end if ... Do While WaitForServerRecieve = True if not exit then DoEvents end if Loop ... Loop3.Form_Unload中 exit = true?
End
End Sub
根本的办法是看有没有没有执行完的代码(如: utiao(天下文章) 所说),或者隐藏的窗口没有卸载之类的问题,你好好查查,找到了之后问题自然会解决,根本不用END。
代码类似:
Do While Not EOF(SelfTransmitFileNum): DoEvents ...
Do While WaitForServerRecieve = True: DoEvents
Loop
...
Loopto utiao(天下文章): 我是不是
1.在Form_Load中加:exit = false
2.
Do While Not EOF(SelfTransmitFileNum)
if not exit then
DoEvents ...
Do While WaitForServerRecieve = True
DoEvents
Loop
...
Loop
if not exit then
DoEvents
end if
...
Do While WaitForServerRecieve = True
if not exit then
DoEvents
end if
Loop
...
Loop3.Form_Unload中 exit = true?
if exit then
exit sub
end if
Private Sub Form_Unload(Cancel As Integer)
Dim frm As Form
For Each frm In Forms
Set frm = Nothing
Next
End Sub