Back

VB006

DoEvents usage

Visual Basic 6
Warning
VB6

DoEvents re-enters the message loop mid-procedure — the same re-entrancy trap as Application

DoEvents re-enters the message loop mid-procedure — the same re-entrancy trap as Application.ProcessMessages in Delphi.

Why this severity

DoEvents re-enters the message loop mid-procedure — the same re-entrancy trap as Application.ProcessMessages in Delphi.


Known false positives

long-running loops that deliberately yield and guard against re-entry.

Remediation example

cmdRun.Enabled = False
' do the work without pumping messages
cmdRun.Enabled = True

Reconnecting… Connection lost. Reload