-
August 4th, 2004, 09:13 PM
#1
Unload Form does not always terminate program execution
I've seen several cases where all of the forms in my app are closed, yet dialog boxes still pop up, indicating a problem.
This makes the users feel uneasy :-)
What is the proper way to COMPLETELY terminate execution in a VB app, after all the forms have been unloaded ?
-
August 4th, 2004, 10:13 PM
#2
Just make sure that after you have unloaded the form there shoud be no code in the program that makes use of the form.
Busy
-
August 4th, 2004, 10:59 PM
#3
I agree with Thread1. If there is a need for a form to call an object in another form, programmer must explicitly define a way so that the calling form first check if the owner of the object to be called is loaded or not.
I am inviting you to join GreenZap. It is just like PAYPAL but it is more rewarding! You get $25 when you join (FREE to sign up) AND you get rewarded also when someone opened an account using your GreenZap promo code! GreenZap is launching June 1st.
Click here and PREREGISTER
Have a break. Visit JonelsPlace
-
August 5th, 2004, 12:15 AM
#4
Oddly enough, I've seen cases where a simple single-form program won't completely unload on a system running winME, but on other OS's it's ok. I used End as the last line of code after the form unloads, which seems to have solved the problem.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
August 5th, 2004, 03:23 AM
#5
Well...are you sure that all forms are unloaded...? You can check it within the 'Query_Unload' evetn of the main dialog...add the following
Code:
Dim FormX as Form
For Each FormX in Forms
if FormX.hWnd<> Me.hWnd then
Debug.Print "Form is still loaded"
Unload FormX
End If
Next
-
August 5th, 2004, 08:03 AM
#6
Avoid End command
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|