What does “DoEvents” do in vb6?

后端 未结 4 1382
太阳男子
太阳男子 2020-12-11 00:18

What does \"DoEvents\" do in vb6 ? Why do I get the error message \"Out of stack space\" ? What does it mean ?

4条回答
  •  旧时难觅i
    2020-12-11 00:58

    I would clarify Johnathon's answer in that it pumps that VB message loop and allows the VB Runtime to process windows messages, which is the opposite of Sleep which allows for Windows to process its events (not necessary in the world of Multicore CPUs and true multitasking OS's but when VB6 was written Windows 9x was the dominant OS and a hard loop that only had DoEvents in it would spike the CPU usage to 100%). So seeing things like

    While fDoneFile = False
        DoEvents
        Sleep 55
    Wend
    

    was a common pattern throughout the VB6 world.

提交回复
热议问题