Computing.Net > Forums > Programming > VB apps and Freezing

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB apps and Freezing

Reply to Message Icon

Name: Matt
Date: November 4, 2002 at 09:00:36 Pacific
OS: W2K PRO
CPU/Ram: P4 1.2 Ghz
Comment:

Has anyone experienced a system completely freezeing from an application they have written in Visual Basic 6 ? I have been told that VB programs CANNOT freeze a computer, and that it must be hardware. But this specific app (which uses On - Com events) seems to freeze computers, no matter where they are installed. Is this possible ??



Sponsored Link
Ads by Google

Response Number 1
Name: Jeff J
Date: November 4, 2002 at 19:29:49 Pacific
Reply:

It's possible for system-interacting software written in nearly any language to freeze the OS. It has less to do with language, and more on what the system is required to do in response to the app, or if the app itself crashes on an unstable system like Win9x/Me. The combination of factors in programming are nearly limitless, so there's always the possibility.

If the system seems to freeze only in response to the app running, then it seems likely the app is the culprit. If the system also freezes when the app isn't run or installed, then the problem is likely elsewhere. It depends on the particular problem, but hardware is not necessarily the most likely cause of freezes.


0

Response Number 2
Name: tech-fred
Date: November 4, 2002 at 20:24:00 Pacific
Reply:

Since you are apparently trying to get data
from the serial ports (ON COM), are you sure
your code is not sitting there waiting for
input from the COM port?


0

Response Number 3
Name: Wayne
Date: November 6, 2002 at 11:50:29 Pacific
Reply:

That is what is happening. I had the same problem when I first started with VB trying to write com port routines. The system is WAITING FOR THE PORT TO DO SOMETHING and it is not doing anything else or watching anything else in the meantime so it appears to lock up since it is so busy watching the port.

SO HERE IS WHAT YOU DO!

In your com port routine wherever it is you have your coding that accepts input from the port. MAKE THIS A LOOP if it is not already.
THEN IN THE LOOP include a line "DO EVENTS" like below.

Do unitl Done = False
DoEvents
MyData = MScomm1.input
loop

Now when there is NO DATA coming in from the Com PORT the DO EVENTS statement will allow input or performing another routine based upon a form button being pressed etc.

This was the SINGLE MOST HARDEST lesson to learn when I started several years ago writing COM PORT routines for VB. I must have bought 5-6 books on VB before I learned this lesson.

Good Luck

Wayne.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB apps and Freezing

Controlling a vb app, from another www.computing.net/answers/programming/controlling-a-vb-app-from-another/8084.html

Embedding EXE into VB APP www.computing.net/answers/programming/embedding-exe-into-vb-app/12942.html

Question Regarding VB.net and C# www.computing.net/answers/programming/question-regarding-vbnet-and-c/3580.html