Re: Shell launch / Process End

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Mike, I'll give that a shot and I appreciate the recommendation on the
programming convention as well. If time and money were no concern, I'd take
some refresher programming courses, I'll have to at some point.

"MikeD" wrote:


"RLang" <Generic@xxxxxxxxxxx> wrote in message
news:4FD65ED3-05DB-4024-85D0-F5CA42FF24C8@xxxxxxxxxxxxxxxx
Hi,
I have a simple VB 6 app that I run two ways. One, I launch it
directly,
do what I need, then Exit. The process appears in Task Manager, then
disappears upon exiting. The second way I launch the app is through a
Shell
command with command line arguments from another app. My app looks for
command line arguments on callup and does the same thing I would have
otherwise done manually, then my code calls the "exit" routine upon
completion automatically. I notice that the app disappears from the
taskbar
but the process remains in task manager and each time I launch it from a
Shell command, a new process pops up and remains after exiting.

I believe the issue somehow revolves around the exit routine. The final
command being "unload me". I modified the code to not automatically exit
if
called up from the shell command. When I close it manually, the process
disappears from task manager. The exit routine is behind a button,
recordset
handles are closed then the unload me is called. When run from the shell
my
code calls this same button_click function automatically but the process
doesn't disappear in task manager.


Something is preventing your app from closing properly. IOW, some remnant of
it, perhaps a form, is still loaded in memory. Best thing you can do is put
a breakpoint somewhere near where your program ends....perhaps the first
line of code in your main form's Unload event. Open the Project Properties
window. Click on the Make tab. In the "Command Line Arguments" textbox,
type in the exact command line arguments that would be passed to your
compiled EXE. This will allow you to debug the scenario within the IDE.

Basically, ALL your cleanup code should go in either the Unload or
QueryUnload events. In your button (that's click to manually close the
program), you should be doing NOTHING but unloading the form. IOW, don't
close recordsets (as you state your doing in the button's code). Do this in
the Unload or QueryUnload event.

Without more details about your app, it's hard to provide specifics. But,
what I've described above to debug this should be sufficient for you to
figure out the problem.

--
Mike
Microsoft MVP Visual Basic



.



Relevant Pages

  • Re: Shell launch / Process End
    ... I have a simple VB 6 app that I run two ways. ... do what I need, then Exit. ... command with command line arguments from another app. ... handles are closed then the unload me is called. ...
    (microsoft.public.vb.general.discussion)
  • Re: App not Ending
    ... But when I close the app it still running on TaskMAnager ... Stop command) in your Unload event and step through the ...
    (microsoft.public.vb.general.discussion)
  • Re: Programming "efficiently" on given hardware - what does it mean really?
    ... >> in a command line world again. ... > launching an app, selecting menu items, hoping it does what ... In a GUI environment, use a RAD tool to whip up a quick, simple UI ...
    (comp.programming)
  • Re: Wordsearch:AI Insanity
    ... bios, what with being hard-coded and all. ... Stop with an error message. ... an undefined command or something, so what happens depends entirely on ... So it's programmed to alter its own programming depending on input? ...
    (rec.arts.sf.composition)
  • Re: Great SWT Program
    ... And, of course, none of the nasty things that you have said or implied ... such rot and squeezing out Java programming related traffic with emacs ... I didn't claim that they could not learn a load of programming skills ... bit is the entire command but is only part of the full command line, ...
    (comp.lang.java.programmer)