Home All Groups Group Topic Archive Search About
Author
8 Aug 2010 1:26 PM
BeeJ
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.

Author
8 Aug 2010 2:25 PM
Jason Keats
BeeJ wrote:
> 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
Author
8 Aug 2010 5:30 PM
BeeJ
on 8/8/2010, Jason Keats supposed :
> BeeJ wrote:
>> 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

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.
Author
8 Aug 2010 10:16 PM
Nobody
Show quote Hide quote
"BeeJ" <nospam@live.com> wrote in message
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.
Author
8 Aug 2010 11:20 PM
BeeJ
Nobody explained :
Show quoteHide quote
> "BeeJ" <nospam@live.com> wrote in message
> 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.

Found some code I am going to take a hard look at.
Author
8 Aug 2010 4:07 PM
Kevin Provance
"BeeJ" <nospam@live.com> wrote in message
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.
Author
8 Aug 2010 5:19 PM
BeeJ
Kevin Provance formulated the question :
Show quoteHide quote
> "BeeJ" <nospam@live.com> wrote in message
> 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.

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.
Author
8 Aug 2010 5:42 PM
Mayayana
| 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.


  Maybe you should post details about that code.
You can't just leave something like that.
Author
8 Aug 2010 9:58 PM
BeeJ
Mayayana pretended :
>> 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.
>
>
>   Maybe you should post details about that code.
> You can't just leave something like that.

will do when I get back to the nasty Vista PC.
I hate to debug there due to several Vista incompatibilities with my
code and having to boot when I run into that API.
Author
8 Aug 2010 11:09 PM
Kevin Provance
Show quote Hide quote
"BeeJ" <nospam@live.com> wrote in message
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.

As Maya asked, post the offending code when you can.  Chances are there is a
better work around that the anticipation of crashes.