[RESOLVED] Random project freeze
Hey there,
Beginning to get incredibly annoyed with a problem im encountering while working on a vb.net project.
The program seems to be running fine until it freeze all of a sudden, and stays like that till u crash it or close it via the debug buttons. I have stepped through my code to try and find infinite loops and cant find any. When i hit the pause button it highlights the following:
Public Class frmMain
Which i dont see a problem with, if i then run or step into the code any highlights disappears and the program seems like it should just be sat there. But it stays minimised and on tryin to select it it wont budge. If you select another window and try to move the focus back to the form it will act as if its not responding, sure we all know what a form/window looks like when thats happened.
I cant think why its happening and dont even know where else to look. The program is only a couple of hundred lines long (excluding the 600+ lines it auto generates for u). Any one stumbled across a similar problem or know whats going on?
If i havent explanded myself clearly enough just say and ill try and change it.
Thanks in advance.
Re: Random project freeze
Hi Matrix!
I don't know exatly how to solve your problem but, you may take a look at those topics of the forum they talk about similar beheavior.
http://www.vbforums.com/showthread.p...Program+freeze
http://www.vbforums.com/showthread.p...t=Program+hang
Hope it help ..
Zak
Re: Random project freeze
Thanks Zakary, unfortunatly the problem persists without any obvious reason.
Its just as if its in an infinite loop (which it isnt) or that my pc is out of memory (which it also isnt).
CPU usage increases slightly but still have atleast 50% free, so that cant be it either. Still have over 250mb of free memory left too, so that rules that out.
Anyone?
Re: Random project freeze
if it helps at all, it hangs when the program (a client application) makes a connection to a another application using a socket. No errors get thrown up and it still manages to send out data as if it was working normally. But just becomes non-responsive.
Tried adding a timer to run application.doevents but that doesnt fixed it.
Have error trapping in nearly every procedure but nothing is being flagged up.
Re: Random project freeze
Ok after many hours and quite a few peoples help, managed to track down the bug (or whatever u will call it) and remove the problem. Still completely confused as to why it happens thou, but atleast i can avoid it now.
If anyone else is having a similar problem, heres how i solved mine. Hope it helps someone else later.
Basically i had two tabcontrols, tc1 and tc2.
During design time tc1 was set to visible, while tc2 was set to invisible.
Now the program would only fail if it came across the code tc2.visible = true. Not that it failed there, that ran fine infact. So did all the other code. But after it finished running the code it would hang (still dont know why), but it only occured after this property was set to true.
But i got around this by settin tc2 to visible during run time and on form load set it to false. Now when it came across the tc2.visible = true it wouldnt cause the program to hang later on
If that makes no sence to you... ive described it well. :p This doesnt make any sense to me but there ya go. I found a way around it and have shared it with u people.
Thanks
Case closed