Author Topic: vb hang  (Read 4084 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
vb hang
« on: August 15, 2011, 02:47:35 PM »
Numsgil, I know that when a program hangs running from the vb debugger, after it stops hanging vb is on top of the active window that hanged.

My qustion is: If I compile the program and it hangs on windows7, will it switch to the desktop? or will it just resume after it stoped?
« Last Edit: August 15, 2011, 02:49:13 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: vb hang
« Reply #1 on: August 15, 2011, 10:09:36 PM »
If by "hang" you mean that it no longer responds to user input (because it's busy doing CPU work), you'll get a "this program has stopped responding" windows message.

If by "hang" you mean it crashed, you'll get a "this program has performed an illegal operation" windows message.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: vb hang
« Reply #2 on: August 16, 2011, 01:13:19 PM »
err... no, I mean it is doing like heavy cpu work for about 3 seconds and then it is fine. I would of got "this program has stopped responding" if I was running it from the debugger as well...

Oh well, when the time is right I will test it and know...
« Last Edit: August 16, 2011, 01:24:07 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: vb hang
« Reply #3 on: August 17, 2011, 01:38:30 PM »
err... no, I mean it is doing like heavy cpu work for about 3 seconds and then it is fine. I would of got "this program has stopped responding" if I was running it from the debugger as well...

Right, this is the first one I mentioned.  If you don't call DoEvents periodically in VB6 (a variety of other languages have other mechanisms), you're not responding to messages Windows is sending you, and windows will assume you've hung.  You need to process the messages so windows still says you're responsive.  If windows thinks you're stuck you'll get the "this program is unresponsive" windows error.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: vb hang
« Reply #4 on: August 17, 2011, 05:54:44 PM »
 :wacko: no, this was a vb bug. The program was unresponsive for too short of a time to cause a crash. Like you say,  If windows thinks you're stuck you'll get the "this program is unresponsive" windows error. I am NOT getting an error. Basically vb freaks out and the window focus literally switches from darwinbots to the vb dev screen. I hope the program will behave more normally when compiled...

BTW, I hope you are not trying to say that a program is more likely to crash from unresponsiveness if I compile it into an exe.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: vb hang
« Reply #5 on: August 18, 2011, 12:45:31 AM »
BTW, I hope you are not trying to say that a program is more likely to crash from unresponsiveness if I compile it into an exe.

It's not more or less likely.  If you don't handle windows messages you'll get the hang message.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: vb hang
« Reply #6 on: August 18, 2011, 12:53:11 PM »
I was able to effectively emulate the bug. When I compiled it, it was fine...

Thanks anyway.