|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Cleanup remnantsCleanup remnants
If my VB6 app crashes, it may leave some files and ActiveX EXEs running. I plan to remove those when the app starts up again (by the user). I know how to deal with files, but how do I deal with the ActiveX EXEs? In Process Explorer I can Kill them. How do i find and kill them from my app after it starts? At that time i would only know their names. I would do this before my app instantiates those possibly same or not ActiveX EXEs. BeeJ wrote:
> Cleanup remnants http://www.google.com/search?q=VB6+terminate+process> If my VB6 app crashes, it may leave some files and ActiveX EXEs running. > I plan to remove those when the app starts up again (by the user). > I know how to deal with files, but how do I deal with the ActiveX EXEs? > In Process Explorer I can Kill them. > How do i find and kill them from my app after it starts? > At that time i would only know their names. > I would do this before my app instantiates those possibly same or not > ActiveX EXEs. > on 8/8/2010, Jason Keats supposed :
> BeeJ wrote: yikes! there are so many ways of doing it.>> Cleanup remnants >> If my VB6 app crashes, it may leave some files and ActiveX EXEs running. >> I plan to remove those when the app starts up again (by the user). >> I know how to deal with files, but how do I deal with the ActiveX EXEs? >> In Process Explorer I can Kill them. >> How do i find and kill them from my app after it starts? >> At that time i would only know their names. >> I would do this before my app instantiates those possibly same or not >> ActiveX EXEs. >> > > http://www.google.com/search?q=VB6+terminate+process I have no clue which way to go. Are any better than others? I would like to enumerate all running and see if mine is there, then kill it. I do not have a form in the ActiveX EXE so I cannot search for a Caption, right? So I need to see what is running by program name, see if it is mine and then kill.
Show quote
Hide quote
"BeeJ" <nospam@live.com> wrote in message You would have to use EnumProcesses, GetModuleFileNameEx, OpenProcess, then news:i3mpjr$ag3$1@speranza.aioe.org... > on 8/8/2010, Jason Keats supposed : >> http://www.google.com/search?q=VB6+terminate+process > > yikes! there are so many ways of doing it. > I have no clue which way to go. > Are any better than others? > > I would like to enumerate all running and see if mine is there, then kill > it. > I do not have a form in the ActiveX EXE so I cannot search for a Caption, > right? > So I need to see what is running by program name, see if it is mine and > then kill. TerminateProcess. If you search for all these functions, you will find a sample. Nobody explained :
Show quoteHide quote > "BeeJ" <nospam@live.com> wrote in message Found some code I am going to take a hard look at.> news:i3mpjr$ag3$1@speranza.aioe.org... >> on 8/8/2010, Jason Keats supposed : >>> http://www.google.com/search?q=VB6+terminate+process >> >> yikes! there are so many ways of doing it. >> I have no clue which way to go. >> Are any better than others? >> >> I would like to enumerate all running and see if mine is there, then kill >> it. >> I do not have a form in the ActiveX EXE so I cannot search for a Caption, >> right? >> So I need to see what is running by program name, see if it is mine and >> then kill. > > You would have to use EnumProcesses, GetModuleFileNameEx, OpenProcess, then > TerminateProcess. If you search for all these functions, you will find a > sample. "BeeJ" <nospam@live.com> wrote in message What do you mean by "crashes"? If it's a trappable error, you should create news:i3mb9c$c2h$1@speranza.aioe.org... : Cleanup remnants : If my VB6 app crashes, it may leave some files and ActiveX EXEs : running. : I plan to remove those when the app starts up again (by the user). : I know how to deal with files, but how do I deal with the ActiveX EXEs? : In Process Explorer I can Kill them. : How do i find and kill them from my app after it starts? : At that time i would only know their names. : I would do this before my app instantiates those possibly same or not : ActiveX EXEs. an error handler routine to do cleanup before the program closes. If you're talking about a GPF, you should determine why that's happening and fix your code. While I recognize no app is bug free, it's important to take as many steps as possible to ensure a crash free application. Planning for crashes tell me too many are occuring. Instead of planning for them, looking into why they are happening and attempting to fix them is a better use of time. Kevin Provance formulated the question :
Show quoteHide quote > "BeeJ" <nospam@live.com> wrote in message Yes, I do.> news:i3mb9c$c2h$1@speranza.aioe.org... >> Cleanup remnants >> If my VB6 app crashes, it may leave some files and ActiveX EXEs >> running. >> I plan to remove those when the app starts up again (by the user). >> I know how to deal with files, but how do I deal with the ActiveX EXEs? >> In Process Explorer I can Kill them. >> How do i find and kill them from my app after it starts? >> At that time i would only know their names. >> I would do this before my app instantiates those possibly same or not >> ActiveX EXEs. > > What do you mean by "crashes"? If it's a trappable error, you should create > an error handler routine to do cleanup before the program closes. If you're > talking about a GPF, you should determine why that's happening and fix your > code. > > While I recognize no app is bug free, it's important to take as many steps > as possible to ensure a crash free application. Planning for crashes tell > me too many are occuring. Instead of planning for them, looking into why > they are happening and attempting to fix them is a better use of time. I have error handling that works and logging that give me reports. But right now I am struggling with API calls that work under every condition I can think of on Win XP, but on Vista the call hangs everything. And in this case even process Explorer cannot kill the main app. I have to boot the computer every time. So I am jut trying to cover the worst case situation and try to clean up as best I can. OK so I am lazy too. when debugging in the IDE I get a crash and shut down the app incorrectly leaving stuff in memory. Killing on startup would clear all that and i would not have to open Process Explorer and search and kill - lots of clicks avoided. | condition I can think of on Win XP, but on Vista the call hangs Maybe you should post details about that code.| everything. And in this case even process Explorer cannot kill the | main app. I have to boot the computer every time. You can't just leave something like that. Mayayana pretended :
>> condition I can think of on Win XP, but on Vista the call hangs will do when I get back to the nasty Vista PC.>> everything. And in this case even process Explorer cannot kill the >> main app. I have to boot the computer every time. > > > Maybe you should post details about that code. > You can't just leave something like that. I hate to debug there due to several Vista incompatibilities with my code and having to boot when I run into that API.
Show quote
Hide quote
"BeeJ" <nospam@live.com> wrote in message As Maya asked, post the offending code when you can. Chances are there is a news:i3movt$88s$1@speranza.aioe.org... : : Yes, I do. : I have error handling that works and logging that give me reports. But : right now I am struggling with API calls that work under every : condition I can think of on Win XP, but on Vista the call hangs : everything. And in this case even process Explorer cannot kill the : main app. I have to boot the computer every time. : So I am jut trying to cover the worst case situation and try to clean : up as best I can. : OK so I am lazy too. when debugging in the IDE I get a crash and shut : down the app incorrectly leaving stuff in memory. Killing on startup : would clear all that and i would not have to open Process Explorer and : search and kill - lots of clicks avoided. better work around that the anticipation of crashes.
ini in app.pth works for xp, best practice for Vista/W7?
Unicode API System Timer Callback? Old VB Project doesn't work with New Office or Windows 7 compile error Only udts defined in public object modules can be coerced ... Make a Backup RegClean Revisited App Hang Reconnection issue between Winsock Server(VB6) and TCP Client (VB.NET) Instantiation |
|||||||||||||||||||||||