Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2005, 05:01 PM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to PakXoxer Send a message via Yahoo to PakXoxer
Default Application still runing even after Ending it

hi,
i m facing a problem that even after i End the
application in Form_Unload event, the application
still running in the background. when i check the
task manager application name is shown there with
the status Not Responding.
please tell me how would i end every procedure running
in the application before quiting from the application.

Regards,
Danish
 
Old February 14th, 2005, 05:11 AM
Registered User
 
Join Date: Dec 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Peppiniello
Default

Hi, the problem may be represent by some form opened not in modal way (i.e. frmMain.Show and not frmMain.Show 1).
So, once unloaded and try to quit the program, that form is still active but hidden.
That's why you cannot "safely" end yuor program!
But this is NOT a bug !
There are many workaround, such as try to remember that forms and use the "Unload frmMain" command, or use the End command in the Unload event of the MAIN form of the program!
Hope this may be useful !


Peppiniello
 
Old February 14th, 2005, 09:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

if you can try not to use the end command to finish your app.

the safest way is to dispose every form once you finish with it... also how do you call the unload event?? or better how do you unload your form?? if you call it to unload and then do more things then the form will not unload...

HTH

Gonzalo
 
Old February 14th, 2005, 03:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

"End" is dangerous, as Gonzalo already said. If what Gonzalo suggested does not work, try this.

"Not responding" status means that the application is calling an external component that is not responding. Even if that component is not called directly, VB may do it for you (for example to close the connection)
This is a not easy problem to track. What I did in the past was to make a list of all the servers I was connected to, and one by one put a 'set server = nothing', followed by a message box, in the QueryUnload event. In that way I was able to find the component that did not want to be released, and the reason why.
And be careful: in this cases the application may work perfectly in the IDE. Always debug the exe.
Let us know.
Marco
 
Old March 9th, 2005, 02:10 AM
Authorized User
 
Join Date: May 2004
Posts: 83
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

In case what've been sujjested by other members didn't work, try this.

It appears that there's some form which is not unloaded even after you "try" to unload it. This happens when you have valid object references in your form, for example recordset and/or connection objects. The ensure your form gets unloaded, make sure that you set all the object references to Nothing in the form unload event. Also make sure you set the form itself to Nothing. This will definitely unload the form.

While an app works, however, there may be multiple forms active or loaded but hidden at any given moment. To ensure you call Unload command on every form, use code similiar to this in the unload event of your main form:

Dim frm As Form
For Each frm In Forms
    Unload frm
Next

I'm sure it'd solve the problem you'r having.




ejan





Similar Threads
Thread Thread Starter Forum Replies Last Post
ending tag ?> Zardooloi Intro Programming 1 August 3rd, 2007 09:11 AM
error when runing application issam BOOK: ASP.NET Website Programming Problem-Design-Solution 6 December 22nd, 2004 04:45 PM
Ending a console application FarCry VS.NET 2002/2003 9 May 26th, 2004 11:17 AM
runing my app. melvik General .NET 10 May 12th, 2004 12:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.