473,378 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Program won't end after form is closed

24
I have a VB6 program that will not stop running after I close out of the form manually. I have to go into task manager to shut it down.

What am I doing wrong?
Apr 5 '10 #1
4 4047
vb5prgrmr
305 Expert 100+
If you have instantiated any objects you need to dispose of them. Like recordsets, controls, and so on. If after the form is unloaded, as if you are trying to save settings and you reference the form or its controls in any way, the form will be reloaded but not shown and thus your program will not end.



Good Luck
Apr 6 '10 #2
CyberSoftHari
487 Expert 256MB
use
Expand|Select|Wrap|Line Numbers
  1. End 
in unload event.
Apr 6 '10 #3
vb5prgrmr
305 Expert 100+
CyberSoftHari,

An expert advocating the use of End in a VB Program??? No expert, moderator, or Guru besides you has ever advocated the use of End in a VB program, in fact, everyone that I know of in the 16/17 sites that I'm a member of know that one should never use End in a vb program. It is bad programming practice to use end in a VB program because your program just stops. It has no opportunity to execute any code in the forms query unload, unload, and terminate subs if you have such code in those mentioned events. It can also lead to the runtimes and any other objects you have instantiated to be left in memory and not to mention the memory leaks it can cause by leaving threads and handles untaken care of....

Just bad advice in my opinion! Don't you think finding out the cause of the problem would be better so that the OP can learn how to properly program in vb would be the better solution???
Apr 6 '10 #4
CyberSoftHari
487 Expert 256MB
yes i agree in this case.
Apr 6 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: BadOmen | last post by:
I am using Win XP and when I exit my program by clicking the X it locks like it is closed but if I check the Activity Handler( I don't know the right English word for it) it is still there under...
4
by: UJ | last post by:
I have a program that will upgrade a service automatically. If the service already exists, it will delete the service and then reinstall it through code. To delete the service I'm using the...
3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
17
by: bastiaannaber | last post by:
I am trying to write a program which uses popen but I have a problem. I want to detect if the program I call with popen has ended. For example: #include <stdio.h> #include <sys/types.h>...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
0
by: Ben Coats | last post by:
Hello I have an MDI application with quite a few forms. On machines running Windows XP I have no problems, but on those running Windows 2000 I do. If a form is opened so that it is on top of...
8
by: koorb | last post by:
I am starting a program from a module with the Sub main procedure and I want it to display two forms for the program's interface, but when I run the program both forms just open and then program...
27
by: cj | last post by:
I run this program and to exit click the X in the upper right corner. But apparently it isn't really ending the program. If I return to VB and make changes then try to rebuild the app it says the...
5
by: Eric A. Johnson | last post by:
I'm trying to create an invisible form to start my program with. It will be the startup object; I have it set at 0% opacity, since there is no Visible property to set for forms (at least, not that...
3
by: cs | last post by:
Hi, I'm new to C and would appreciate any feedback on the following program, asplit, which splits a file into 2 new files, putting a certain number of lines in the first file, and all the rest...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.