Originally posted by James Stanich Have you tested this theory?
You could put:
VB Code:
app.taskvisible = false
instead of:
VB Code:
END
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
Originally posted by phrozeman What does that have to do with closing ur application?
It's just to hide ur app from the windows tasklist
Using:
VB Code:
Unload me
or
VB Code:
unload f
Would just unload the application but it would still show in the windows tasklist.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
true, but i would still recommend using End instead of taskvisible. end does more than just removing the app from tasklist, which once the forms are unloaded properly, is a good thing
Err, that only happens if you terminate your application in a bad way, or your computer is majorly screwed up, because I've never needed it...
You'd want app.taskvisible=false if it takes a while to unload and you don't want your average user to notice. However, it does nothing with respect to unloading your program.
Originally posted by snakeeyes1000 true, but i would still recommend using End instead of taskvisible. end does more than just removing the app from tasklist, which once the forms are unloaded properly, is a good thing
Using:
VB Code:
END
Is always bad practise because your program would crash.
You'd want app.taskvisible=false if it takes a while to unload and you don't want your average user to notice. However, it does nothing with respect to unloading your program.
I know but I have always had my application still show in the task window after I have closed it using:
VB Code:
unload me 'Or whatever
I just add:
VB Code:
app.taskvisible=false
To make sure I don't get this problem after the program finishes.
Last edited by Nightwalker83; Mar 12th, 2003 at 02:28 AM.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
The problem with using app.taskvisible = false is that it won't unload your application! It'll only make it seem like it has been unloaded.
If it isn't unloading when you do unload me, then you need to make sure that no functions being called after "unload me" are referencing any forms or anything in or on forms.
Go ahead and attach a simple project where after the "unload me" statement (and ALL the forms have to be unloaded, not hidden), it does not disappear from the taskbar.
The problem with using app.taskvisible = false is that it won't unload your application! It'll only make it seem like it has been unloaded.
I meant use it like this:
VB Code:
Private Sub Command1_Click()
App.TaskVisible = False
Unload Me
End Sub
On some computers the application name stayed in the Task List after using:
VB Code:
unload me
That why I added it in I am NOT say you have to use it though.
Last edited by Nightwalker83; Apr 19th, 2003 at 07:18 PM.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
The reason you are needing to put app.taskvisible = false or End after a form unload is because your unload ISNT unloading and destroying the form, but leaving a reference out there that you didn't cleanup. Try putting a:
Code:
set formname = nothing
where formname is the actual form name in the unload event of the form.
Do not use
Code:
set me = nothing
If you unload the form and destroy its reference (assuming you have done the same for any other object you have created) you will not need End OR app.taskvisible = false
Originally posted by VBGuy The reason you are needing to put app.taskvisible = false or End after a form unload is because your unload ISNT unloading and destroying the form, but leaving a reference out there that you didn't cleanup. Try putting a:
Code:
set formname = nothing
where formname is the actual form name in the unload event of the form.
Do not use
Code:
set me = nothing
If you unload the form and destroy its reference (assuming you have done the same for any other object you have created) you will not need End OR app.taskvisible = false
If you bothered to read the posts you would have noticed that I have already stated what you have said.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
Originally posted by Pc_Madness End doesn't clean up memory used by your program and such. One of the guys will give you the list of why its a bad idea.
Are you sure about that?
I mean any memory you open up yourself doing anything tricky - fair enough you should clean up afterwards, but surely VB6 does its own garbage collection for normal stuff like forms? Certainly I can't find anything in the VB samples or documentation about this (sure somebody will now prove me wrong) and it seems like an important thing to document if it's true.
We have a large and complex application that we run all day on several PC's. A timer closes it with a simple END statement each night and the PC's stay on 24/7 for the backup tape to run. If what you say is true, I would expect to see some memory getting chewed up each day - but Task Manager does not show any memory leakage at all.
Now I've set myself up as a target, somebody want to take a shot?
Brian
(Fighting with the RightToLeft bugs in VS 2005)
Well yes. Obviously if you go outside of native VB with a dll call to deliberately allocate memory and don't free it, of course you will have a problem.
But if you simply have a number of forms open and call End from a module, VB seems to clean up after itself.
I can't see it's possible to write a universal 'catch all' exit procedure guaranteed to clean up everything. You just have to do it on a case by case basis. And I'm not convinced you need to set any open forms to Nothing before Ending, so long as the End statement is not inside one of them. Vb seems to do that automatically. At least that is what experimentation seems to show. Anyone got sample code to demonstrate to the contrary?
Brian
(Fighting with the RightToLeft bugs in VS 2005)
If you look on Planet Source Code, search for BFChat, and look under the same sub inside the Client portion (bfcc.vbp I think it is), you'll see an example of this in action.
If the user tries to exit while it's trying to connect, the program displays a message box telling you to wait. It doesn't call End yet until either it's completely connected, or fails to connect.
If the user tries to exit, and the winsock state is not trying to connect, it will just exit as usual. Then look in your Task Manager if you're running XP. You will find that it's not under the Applications or Progresses tabs anymore. It has freed up the memory used by the program, as it's supposed to do.
Granted the dude's code's a bit messed up (it takes some doing to figure out what the variables he used are for), but I think this is a good example of how you can do what you tried to do in your End.vbp file.
Last edited by hothead; Jun 23rd, 2003 at 05:15 PM.