Re: preventing dos window close upon program termination



I'm sorry that I was unclear. I worked around my issue the day of my initial
post, and I am only following up out of curiosity. (I didn't remember exactly
what I was trying to do).

While debugging, the call stack certainly serves my purposes, and is far
more reliable than buffered output. You're very right about that.

My crash behavior differed between debug and non-debug modes. When *not*
debugging (ctrl+f5), a page or two of text was printed just before the crash,
and I was unable to read it because the box quickly disappears. That's the
text I was looking to view after termination.

I think I wound up running it outside of the IDE from a cmd.exe to view the
text. It may be handy to change ctrl+f5 behavior to run in a cmd.exe, but
it's a rare enough case that it's probably not worth the trouble.

-jrr




"Yamin" wrote:

From what I gather...
You are running the application in debugging mode and the program
crashes.
You want to see all the text normally sent to the console.

Normally, if a program crashes, the debugger will stop and show you
where it crashes. From this point, you can inspect whatever you want.
Seeing all the console outputs is not reliable if the program crashes.
Some of the output might not show up on the console (buffering...)

When it crashes, view the call stack and then track backwards.

Y


On Oct 17, 1:29 pm, jrr <j...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Thanks for the responses, but neither quite fits my needs. I'd like to see
the last bit of output from a program before it crashes - while running
inside vs.net.

"Bryan Phillips" wrote:
The Dos window you are referring to is the console window and is not the
same thing as cmd.exe. The console window WILL close when the program
terminates and you can't change that. If you need to see something in
the window after your main program logic runs, add a Console.ReadLine()
as the last line in your program. Then, the console window will stay
until you press the Enter key. Keep in mind that you program is
technically still running as far as the operating system is concerned.

Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com

"jrr" <j...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2DB466E6-62D7-462B-9FC8-D102134E8BAB@xxxxxxxxxxxxx:

How can I cause the dos window that my program executes in remain open after
my program quits? (I'd like the debugger to behave as if I ran my program
from cmd.exe instead of from explorer)

I can get similar behavior by inserting a breakpoint right before
termination, but I'm looking for a breakpointless solution.

Thanks!


.



Relevant Pages

  • Re: preventing dos window close upon program termination
    ... Normally, if a program crashes, the debugger will stop and show you ... Seeing all the console outputs is not reliable if the program crashes. ... The console window WILL close when the program ...
    (microsoft.public.vsnet.debugging)
  • Re: Console and Form together in one application based on EXE parameters
    ... I frequently use that technique when debugging. ... If he starts with a console program, then he can call FreeConsole to get rid of the console window afterward, but there's still an unsightly flicker as the OS creates the window but before the application has a chance to remove it. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Disappointed
    ... have debugging settings enabled? ... Read through the chapter on kernel debugging in the ... me it crashes within a couple of days. ... 200Mbp and 20 outgoing feeding aprox 200Mbps. ...
    (freebsd-stable)
  • RE: Generic VESA framebuffer driver and Video card BOOT?
    ... It is hard to use native VGA for s3 debugging. ... I don know if serial console or net console ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Tcl crashes
    ... If you can get Tcl, Tk, Itcl and whatever extensions you used compiled ... Tcl has some memory debugging ... It is expensive and slows down execution of the app substantially. ... the app always crashes under windows. ...
    (comp.lang.tcl)