Computing.Net > Forums > Programming > what can cause your vb program to c

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

what can cause your vb program to c

Reply to Message Icon

Original Message
Name: BeachCrab
Date: July 9, 2005 at 07:20:26 Pacific
Subject: what can cause your vb program to c
OS: winxp
CPU/Ram: 3.2g
Comment:

hey all,

got a question please:

what can cause your VB to crash?

I am working on a program... and as you might have read my previous post, i was successfull in getting the tabdock control to work.

before adding the tabdock control, my project functioned and behaved properly (i.e., no crash on exit)

but since the time I added the tabdock control, everytime I run my program through the VB IDE and exit the program, the VB IDE closes with it (crashes) without giving any error messages...


what can I do to solve this problem?

[I am using TabDock control v3.13 | VB 6.0]

-BC


Report Offensive Message For Removal


Response Number 1
Name: StuartS
Date: July 9, 2005 at 08:45:46 Pacific
Reply: (edit)

How are you exiting the programme?

Normally the only thing that would cause the IDE to close when a programmer terminates is if you use the terminate process API.

Are you terminating the application with the End statement. If so, don't. That can cause all kinds of problems.

Have you tried compiling the application and running it outside the IDE and see what happens.

Stuart


Report Offensive Follow Up For Removal

Response Number 2
Name: BeachCrab
Date: July 9, 2005 at 09:40:03 Pacific
Reply: (edit)

Stuart!!!!! YOU ARE MY HERO!!!!!!!!!


Ok, well, that was not bad!!!


Damn man, you are a Genius!

I heard that if you use "End" in your programs, it can cause all sorts of problems... but got the practical demonstration today!!

One question though: WHY?? (Why, using End, Can cause these kinds of problems?)

If we don't use "end" what should we use? "Unload Me"? or is there a more sohpisticated way of ending a program?

Also, before I included TabDock control, the program ended just fine (even though I was using END to end(or terminate) my program....

please shower some light on this area for me....


Thank you once again!

-BC


Report Offensive Follow Up For Removal

Response Number 3
Name: StuartS
Date: July 9, 2005 at 11:01:08 Pacific
Reply: (edit)

Hi BC,

Glad you got it sorted. End is a carry over from the days of DOS basic. It should only really be used as a debugging aid in conjunction with the stop statement.

When you use end it does just that, ends the application with no tidying up of forms, code or anything else left in memory. In this instance it was probably leaving a something behind that was trying to access the TabDock control that was no longer there.

The proper way to terminate a VB application is to close all forms with the Unload statement. Once the last form is unloaded, the application will terminate gracefully.

You can use the QueryUnload event to check that the form can unload, close any data records and if necessary, halt the unload process and allow the application to continue.

End is evil!!

Stuart


Report Offensive Follow Up For Removal







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








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software