Program Not Terminating Properly
When my VB program ends it leaves something running. If I run the program three times then press CTRL, ALT, DEL I can see three "remnants" of my code still running. Any thoughts?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Program Not Terminating Properly[URGENT]
When i exit my application i unload all the forms and set the form object to nothing like this
for each frm in Forms
unload frm
set frm = nothing
next
Still i get the runtime error and couple of errors from the VBXPMenu custom control. The error message screens i have attached with this thread. So, if anybody knows how to solve this problem, Please reply ASAP. very URGENT!!!!.........
Terminating My Own Program
Hi, i need help again =/
whats the code for terminating my program cause i want to make an exit button
thanks in advance
Terminating Program
i have a small annoying problem. when my app is closed suddenly (ie X top right corner) the forms close but the process keeps running. Now in my form_unload I have set all forms to nothing - and NEVER use end statement. I have 6 forms, 2 user controls, and 2 moduals. On closing will all the modules be closed aswell? Do i have to set each and every global string variable to nothing aswell, what about the arrays? Every post i have read so far just states set all forms to = Nothing , never use the end statment. This is becoming quite irritating.
thanks in advance
Program Terminating
I've got a program which operates properly on multiple pc's yet on another it is self-terminating. Any ideas on how to find out what's causing this? I've added msgbox's at every point in the program which initiates a normal shutdown but the program dies without every giving a message
VB Program Not Terminating
I'm having an issue with a VB6 program not terminating properly. The exe continues to run even after all objects have been destroyed, all forms unloaded and the End statement is issued. I have verified that all of this is happening via logging and I receive no errors during the shutdown routine. It's running on a Windows XP Pro OS with updated SPs. This same program is running on many other machines of various OS's without any problems shutting down.
Any ideas on this would be greatly appreciated! Thanks!
Error In Terminating A Program
Hi there I am developing aprogram now using sub classing in VB. I ma using the VBSmart Subclass dll in my project..
Now my problem is whene i want to exit the program end use the "end" statement i am getting this error: "application error, The instruction at 0x601a94c5 referenced memory at 0x00041f4a. The memory could not be read"
What seems to be the cause of this error.. Is there any way wherein i can terminate the application without using "end" statement? I already try "unload me" in the form but the application is still running..
IANIAN
VB6 - Terminating VB After Program Execution
Hello good people,
I need some clarification on one minor issue with VB. My programs runs okay but after the program execution and "Exit sub", the program is still not done. I have to manually go to code area to click on Run/End to terminate the program.
Should I let it go to "End Sub"?
The reason I am raising this issue is because yesterday, I ran my program after making some changes. When I went to run the program again, it says "file is already open". I had to manually end the program then the error went away.
Question: what is the appropriate way to terminate the program after it completed execution and "Exit Sub"?
Thanks.
Below is where I am ending my program after successful execution:
Code:
'unload/terminate the ftp object
Set cFTP = Nothing
Set txtfl = Nothing
Screen.MousePointer = vbDefault
Exit Sub
Errorhandler:
MsgBox Str(Err.Number) & ": " & Err.Description, , "Error"
End Sub
Giftx.
Terminating Program At Runtime
I am wondering if VB lets you terminate an application ran from an open project, immediately with a key, like F8 or something similar to that? Right now I am debugging and this would be extremely useful.
Thanks
Nightfox02
Terminating (quitting) Your Program
I want to provide a "Quit" button.
What code does one use to quit their VB program?
Is it just a simple case of putting "End" in the OnClick() event of the button?
Thanks!
Not Terminating Program Correct
HI,
I have a problem with one of my programs.
When I end the program trough the unload event it stil stays running in taskmanager. The form closses and all code is handled.
I have tried to set all forms and references to nothing but still the same result.
I have tried exitprocess 0 but that leaves the form visible but the program is not responding after that.
Anyone a suggestion what I can try?
One thing I have created a winsockcontrol that i use on the form but i disconnect the winsock after use. could there be a problem?
Is there an way to see what keep the program from closing?
By the way al other programs don't have this problem. the only difference is the winsock component and a different database connection also through an control.
Thanks,
Boudewijn
Terminating A Program With Its Title Bar Caption
hi,
i have this program at home that i must of installed accidently off the internet (while installing something else). And when it runs there is no way of closing it, it doesnt appear in the ctrl+alt+del menu and it doesnt have the close button at the top right hand corner. I was thinking that i could create a program where I type in the title bars caption and when i click a button it will terminate the program. Would anybody know how i could do this?
Thanks
Nebula
Terminating A Previous Instance Of A VB Program
I can prevent a new instance of a vb prorgam from running by checking for a previous instance and unloading the new instance. See code below:
If App.PrevInstance then
Unload Me
endif
But what I really wanted is to kill the old instance when the new instance is run. How can I do that?
Make Terminating A Program Nearly Impossible
Before anyone asks, this is not for a malicious program. I'm making a security program. Is there a way to make it impossible to terminate your program , even in Windows XP. Is there a code to disable TerminateProcess just for your program?
Terminating Of Activex Exe Program (out Of Process )
I have created an activex exe component which prints using crystal activex control a report.
Even after printing and completion that process is still running. How to stop or terminate that process
after my job is completed.?
Please help me out from this.
Program Not Terminating When Pressing The Close Button
I have a real weird problem. My program keeps running in the background when you click on the [x] button.
I have no idea why this happens nor how, but I need it to totally terminate. I have checked my code for errors and left open connections/recordsets but there are none to be found to my knowledge.
The only thing I can think of that is happening is when the program begins it asks the user to choose which database he/she wishes to open and then uses frm01.Show to load the rest of the program. I have a feeling since it is working this way the frm01.Show close [x] button is only hiding the form.
Any suggestions? Ideas?
-Matt
Closing Program Properly
Is there any good way to fix the problem that a program will stay in the task manager's processlist after you have closed it with the "x" button?
If the user exits the program in a way that calls the "end" functiom, then it is closed correctly, but closing a program by force with the "x" button always leaves the program in the processlist even when it's not visible anymore.
Then if the user tries to open the program again, an error will appear that the program is already open, because it's in the processlist.
Now I can't stop the user from exiting the program using the "x"-button, so how do i fix the problem?
Close Program Properly
Hi,
When you click on the X in the top right corner it closes down my program visually, however it is still running in memory.
Is there a way to unload the program when a user clicks on the X.
Thanks in advance.
jono
Properly Quitting A Program
Hi!
I did some searching on previous threads about ending a program properly. I found a lot of good stuff and basically got the stuff that I was looking for. But there is 1 minor problem, the msgbox pops up twice if I place an unload sub in my mainform (check the code). My program is a basic executable with 7 forms and with no objects other than 'f'(at least that I know off).
I have this code on my mainform:
Code:
Public Sub ProgramQuit()
Dim f As Form
For Each f In Forms
Unload f
Next
Set f = Nothing
End Sub
'I have the following in all of my forms...
'if I included this in my mainform, the msgbox appears twice when i try
'to end the program from any form other than the mainform
'but if i took this out, there will be no msgbox when I try to end the
'program from the mainform
Private Sub Form_Unload(Cancel As Integer)
Dim Response As Integer
Response = MsgBox("Do you really want to exit?", _
vbQuestion + vbYesNo, "Exit?")
If Response = vbNo Then
Cancel = True
Else
frmMainform.ProgramQuit
End If
End Sub
basically, I want to ask the user only once when he/she tries to quit the program from any form.
Program Not Closing Properly
I have an application that I just developed. Its a VERY simple app and I've noticed that about half the time that I "x" out of the program, it still leaves the EXE process open.
There is no other way to close the Application except with the X on the form. So, how can I remedy this?
Should I run a process kill command on Form Unload? If that was the case, I'm imagining that I would need to make that an IF statement to see if the process is running FIRST, and if so, then kill.
Any ideas?
The only thing I can think of, as to why this may be occuring, is that I'm using the MB Task Control (something I've never done before) and perhaps it's (the program) getting confused...
Program Does Not Terminate Properly
Well, after reading various posts in this forum, I use the following code to terminate my application :
Dim frm As Form
For Each frm In Forms
Unload frm
Set frm = Nothing
Next
App.TaskVisible = False
End
But still, the program does not terminate properly. Recommendation ?
Program Won't Properly Close
Hey guys
Simple quesion - Why won't my program close corectly? It disapears off the screen alright, but when I do an alt-ctrl-del it's still in the list.
Thanks.
Closing A Program Properly
Hi folks,
I have been told just using End is not the best way to properly end a program.
I have definately seen how to do this on the forum before but cannot for the life of me seem to find it. I know it's something about looping round all the active forms, but can't seem to figure it out?
Anybody got any ideas?
Cheers
Nige
Using Eof Properly? I Want To Make A Logfile(.txt) Of My Program..
i want to record the times when that button was clicked.. it's for my record keeping.. tnx.. when i tried to use the
Code:
open "yo.txt" for output as #1
if eof(1) then
write #1, "PC" + cmdbutton(index).caption
end if
close #1
it keeps on overwriting.. i expected that in my logfile which is yo.txt, it would go to the next line everytime i clicked that button..
Program Wont Exit Properly
Hello.
My **** program wont exit properly. I have tried multiple way to close it "end" unload the forms And then end. The program is just simple chat program it contains an array of winsock controls and 1 form. When I close the program it is still in Task Manager. I have tried this on 2 diffrent computers so it's not just a corrupt dll or something.
Please tell me how to do this even if it involves ending the process with an API or something I really need this fixed.
Program Doesnt Close Properly
I made a program and i run it using a Sub Main, but the problem is after i close it the program keeps running (eg in ctrl alt del u can see it) and im not sure how to get rid of it completely.
Program Doesnt Close Properly
Hi
i have created a program which has no errors at all apart from the user closes it (after use) it doesnt end properly - i use Unload and load to switch between the 2 forms during runtime.
but the user has to use CTRL-ALT-DEL in order to properly exit it from the taskbar - how can i fix this error?
i have included a copy of it for reference.
thx
Program Not Closing And Exiting Properly.
I have forgotten one of the first things I learned.
How do you properly exit a program.
I have clicking exit "end"
But I know theres some other way, thats better, that sorta unloads the program.
Sometimes after closing the program, taskmanager shows it still running.
Even clicking the menubars "x" sometimes leaves it running.
Unable To Unload And/or End Program Properly
I have tried so many things, and I have tried posting in DivX forums, and so far have been unable to obtain help. I am up against it on this one. I have tried everything I can think of. Visual Basic isn't my language of choice, but jobs are jobs, and you have to do them. Please help me in my problem.
Read the thread here. To see everything I have tried.
Basically I cannot get the program to end properly. I have tried many configurations! I am about to pull my hair out.
I would greatly appreciate any time and help someone can offer to assist me in this endeavor.
JS
Closing A Program Properly Code...?
does anyone know of a could the will make sure the program is completely closed and out of the memory. When i close my program and the just in the Task Manager it's still there. i have to End Task on it.
Program Occassionally Not Unloading Properly
my project consists of an MDI form, and a bunch of other forms (not all are MDI childs). occassionally, however, the program doesn't unload properly (ie. i have to use ctrl+alt+del to close it).
i have this code in the MDI form module
VB Code:
Private Sub MDIForm_Unload(Cancel As Integer) Dim frm As Form For Each frm In Forms Unload frm Set frm = Nothing NextEnd Sub
but my users are saying that it still sometimes doesn't close properly. any ideas, or could this just be something to do with windows that's beyond my control?
Program Doesn't Close Properly
i have a program in VB5 that uses MDI form.
if i press the exit button - it exits ok
but if i press the 'x' sign (close) then it stays in the task manager.
how do i fix this??
thanx
Installed Program Will Not Work Properly ...
I have now made an installation of my VB6SP6 program. When I make the installtion on my own computer (=also the development computer) everything works fine, including two Datareports. When I make the installation on a another "new" computer everything in the program works fine, but not the two Datareports. When I come to that part in the program a faultmessage appears, something like
Run time error 713 ....undefined object
My guess is that it has something to do with the Datareport-object. Both machines has WinXP installed
Q is: Do I need to send some special files along with the installation package, besides those found by my Installer program (similar to PDW but from 3rd party).
I'm a real newbie on this matter
Edited by - kon on 8/1/2004 6:34:12 AM
Program Not Running Properly On Win95
hi all,
im back to vb for a while!
i have a really very simple example program (see attachment) that uses Kernel32.dll(for BEEP), msvbvm60.dll (all vb6 programs require this) and mscomctl.ocx (activeX control to give me access to slider control.)
The program works fine on my pc, and other XP machines.
however, when i come to use it on a Win95 machine, it will just "beep" at a mono frequency, regardless of whether or not i change the slider value, which should update the frequency.
Now, according to this post made by me earlier this year, i simply need to put the appropriate dll's and controls onto the same cd as the executable. I have done this and i try to run the program. It runs fine, except for the mono-frequency. I have tried placing the above files in %systemroot%system and %systemroot%system32 and registering the control, but to no vail. I get an error when tryin to register a dll, but the ocx registers ok.From what i could tell, the above dirctories are actually void of any dll's, which is quite strange...
i could use package and deployment wizard, but is a bit pointless for such a small program.
any ideas any1?
cheers
Stored Procedure Not Run Properly When Called From VB Program
Hi,
I modified an existing VB program that executes some Stored procedures in a Microsoft SQL Server 7 database and created a new .exe file.
When I deployed the program it doesn't seem to run one of the stored procedures properly. I don't get any errors. The stored procedure updates 80,000 records when it works properly. But when called from the program it onl updates 60,000 and I don't get any errors. After I noticed that the program hadn't run the stored procedure properly I manually exectued the Stored Procedure against the database. It converted the correct number of records then.
I then rolled back to the previous version of the exe and the correct number of records were also converted. This leads me to believe that there is a problem with the new .exe file that I created.
Has anyone experienced similar problems? Do you know why it happened.
Any help ideas appreciated.
Thanks
ERROR::program You Have Installed May Not Display Properly!!
hi everyone,
earlier i was using oracle 9i lite5.0.1 and evb3.0 on WINCE.
Now my Pocket pc has new Windows mobile 2003 and when i try to install
the mobile client onto pocket pc ,i see the below warning message on pocket pc.
""the program you have installed may not display properly because it was designed for
a previous version of windows mobile software""
my query is whether i have to purchase new Oracle 9i lite 5.0.2 [supports-pocketpc 2003] ?
or
reinstall my pocket pc with WINCE.
please suggest me the best way out of this OR any better alternative.
thanks in advance
regards
Naveen
Task Manager Reveals Program Doesn't Shut Off Properly
ITtoolbox visualbasic-lHello all,
The problem is the following :
I have some project myProgram.vbp which becomes myProgram.exe after compilation.
When using the "x" button top right of the form, the program shuts off as expected, but when I check in the task manager, it is still running.
What is going wrong ?
willibrord oomen
Terminating An App....
I hear that the best way to tarminate an app is not the End statement but to unload all the forms.Is that true ? If so then is the next code the right way ?
For Each Form in Forms
Unload Form
Next
TIA
Terminating Exe
hello ! How are you? hope you are all doing well.
i have problem . i dont know how t o create this:
i have fseditor.exe running (game) and i want when i press F12 on my keyboard that fseditor.exe (game) automatically exit (terminates)
if someone can help me ...
VB Is Terminating Itself..
I have a problem with my VB APPLICATION.
I am executing this code
-------------
With orditem.adorditem
.CommandType = adCmdUnknown
.RecordSource = "Select * from orditem where ordno='" & ordfield(0) & "'"
.Refresh
End With
-----------
it is working fine for a couple of times but the giving a error "Method refresh of Adodc Failed".........
after this error vb is terminating automatically, before terminating this error is flashed
---------------------------------
VB6.exe - Application error
The instruction at "0x007015c8" referenced memory at "0x007015c8". The memory could not be "read".
Click ok to terminate & cancel to debug..
---------------------------------
I will be greatfull to the person who can solve this problem.
Thanks In advance - Rohan
VB Is Terminating Itself
I have a problem with my VB APPLICATION.
it is terminating automatically, before terminating this error is flashed
---------------------------------
VB6.exe - Application error
The instruction at "0x007015c8" referenced memory at "0x007015c8". The memory could not be "read".
Click ok to terminate & cancel to debug..
---------------------------------
I will be greatfull to the person who can solve this problem.
Thanks In advance - Rohan
Terminating DLL Objects
I'm sure this is all explained somewhere but the search terms seem to be evading me for now
From the examples I've seen, dll's containing a class, maintain an object variable in a standard module to provide a reference to the class throughout the project.
In my dll, a private object variable in the class references the client application for various tasks, so my natural instincts are to ensure that the class handle is released before the code terminates. But setting the object to Nothing from a method in the class, crashes the parent application utilising the dll.
However, if I don't set the class variable to Nothing, nothing crashes, and initial investigations lead me to believe that there are no resulting memory leaks.
Have I've missed something?
Terminating A Process
Hi I'm creating an .exe that moves files to predefined directorys and then calls another program that deletes the original .exe!
The problem is that the program that is suppose to delete the original .exe is trying to do so before the original .exe has terminated! what I want to do is find the ProcessID of the original .exe and store it in a control within that process. Then what i will do is pass that PID to the second application using a DDE conversation so that the second application can use the TerminateProcess command to terminate the process and then delete the original .exe leaving only the second application stored on the PC.
How do I get the PID of the process?
How do I use TerminateProcess to Close the application?
PS. Any help on DDE Conversations would be great as I havn't quite got the hang of it yet!!!
Terminating Application
Is this possible to terminate one actually runing application.
(eg. the Winamp is running and I want to close it automatically at 12:00 o'clock)
Terminating A Process From VB
Hi all, I want to terminate a process from VB .How do I do it? I know there's a funcn called "TerminateProcess".But how do I get a handle or processID for the particular process I want to terminate?any API calls available.
I serched a lot but most of them were aimed at terminating Current process etc.....
Terminating Sequence
Hi All, i need advice on the following:
I have an ActiveX project:
In this project, there are two usercontrols in it,.
One of which is defines as Public = true (this UserControl is known as WFAnalyser) , it uses a Usercontrol that is also in this project but with it Public set to False.
As mentioned in my previous post, sometimes have problems terminating my application which uses this UserControl.
i decided to do a check on which terminate first and was shocked to find the the main usercontrol terminate before the usercontrol its holding.
how do i terminated the child usercontrol first before the usercontrol control i am using is terminated
sorrry for my bad english.
may i do some more explaination:
Project WFAnalyser:
UserControl Name: WFAnalyser_Control
UserControl_Public = True
Contains: OGLScreen
in the UserControl_Terminate: Msgbox "WFAnalyser"
UserControl Name: OGLScreen
UserControl_Public = False
in the UserControl_Terminate: Msgbox "OGLScreen"
End of Project WFAnalyser
Project Demo:
Exe Name: Demo.exe
Contains: WFAnalyser.ocx
When i run the program in VB IDE: i get WFAnalyser then OGLScreen,
is this correct?
Is this the cause for my application sometime getting the error message, then asking me to send the error report to Microsoft?
Thanks and best Regards.
App Terminating Problem
Hi all,
I do face a strange problem. I already read many posts here before, but unfortunately couldn't find what I'm looking for.
When I do 'Exit' my application in then VB Developer programm I do have no problems. Unfortunately when I exit the compiled .exe the process is only terminated about 10sec. after the program was finished.
Although the program disappeared immediately in the task manager, the process is still running for approx. 9-10sec - why??
Does anybody know how I to check the reason for this delay?
Many thanks.
Cheers
Stefan
Self Terminating Programs
I was just thinking if it was possible to have a program terminate or delete itself? And i am having a problem with an inputbox. I have it so the user can input a path of dir to remove, but when the user clicks cancel i get a Run-Time Error '53'. I have an errhandler set up and what i wanted to do was have to program restart from beginning. Is there a restart or reload command?
|