Re: Why does console window appear

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: John Spaith [MS] (jspaith_at_ONLINE.microsoft.com)
Date: 11/30/04


Date: Tue, 30 Nov 2004 12:54:09 -0800

Disclaimer: I'm used to the kernel debugger, not EVC/PocketPC development,
so this may be way off base...

Put a simple printf() statement at the beginning of your app and load the
app up in the debugger, with a break point right before the printf. See if
you can step into the printf statement. This won't be all that helpful in
itself, but you should be able to put a break point on the printf function
implementation. When your app hits the offending rrintf statement for real,
hopefully it'll get hit in the debugger and you'll have a guilyt call stack.

On actual shipping devices that don't have a console, I don't think this is
a huge deal because the output will be redirected to the DEBUGOUT which most
of the time just is thrown into the bit bucket. However it would be cleaner
if you could remove any code that was doing printf()'s or at least get them
so the were in DEBUG code only. Also there's the danger you could disclose
some private information in these printf()'s that a bad guy could hook a
console/debugger into to retrieve.

-- 
John Spaith
Software Design Engineer, Windows CE
Microsoft Corporation
Check out the new CE Networking Team Blog at http://blogs.msdn.com/cenet/.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2003 Microsoft Corporation. All rights 
reserved.
"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com> 
wrote in message news:OQerbTv1EHA.824@TK2MSFTNGP11.phx.gbl...
> Yes, that's probably what's going on.  As far as who or how the print is 
> occurring, no, I don't know where to look, unless for part of the string 
> that is displayed or for printf or cout.
>
> Paul T.
>
> "dittA" <dittA@discussions.microsoft.com> wrote in message 
> news:7CCA1A27-13AC-4FA4-B3D8-E34FD0FFFF3B@microsoft.com...
>> Hi thanks for your response. The device is a Dell Axim x3i Pocket PC.
>>
>> The program is a port of a large win32 program.
>>
>> I do have a "MS-DOS command" program installed. I think this came from 
>> the
>> PowerToys package.
>>
>> So if I do a printf or std::cout. in my program this will get directed to
>> this window???
>>
>> Any advice how to quickly track down the offending statement? As it is 
>> not
>> obvious from the output where this is in the code.
>>
>> thanks
>> dittA
>>
>> "Paul G. Tobey [eMVP]" wrote:
>>
>>> At a guess, the program is opening the window, either because it's 
>>> calling
>>> printf() and has set itself up to allow standard I/O to go to a window, 
>>> or
>>> because the OS has a console driver installed and it is catching that
>>> printf().  If you told us anything about the device or the program, it 
>>> would
>>> help...
>>>
>>> Paul T.
>>>
>>> "dittA" <dittA@discussions.microsoft.com> wrote in message
>>> news:EAA97A32-11B0-468D-B465-C609556B0553@microsoft.com...
>>> > Hi when running a program on pocket pc, I get a console window appear 
>>> > with
>>> > 3-digit numbers in angle brackets.
>>> >
>>> > What is causing this?
>>> >
>>> > Thanks
>>> > Ditta
>>>
>>>
>>>
>
> 


Relevant Pages

  • Re: basics
    ... As for using printf rather than puts, ... console window, run the program, and then close the window before you can ... Stupid stupid stupid. ... Just teach them how to use a console ...
    (comp.lang.c)
  • Re: Question on strncmp / strnicmp use
    ... Why Not Use Printf? ... system with printf quicker than learning how to use a proper debugger ... When you catch a bug you can move up and down the stack to see the ...
    (comp.lang.c)
  • Re: mnemonic
    ... I'd say that about half of my bugs I find with printf. ... I find with a traditional debugger. ...
    (comp.lang.c)
  • Re: mnemonic
    ... I'd say that about half of my bugs I find with printf. ... I find with a traditional debugger. ... hardly ever orders of magnitude faster. ...
    (comp.lang.c)
  • Re: Seriously struggling with C
    ... What I am missing here is that using breakpoints debugging code can be ... One true, but extreme, example where a debugger and ICE combination were invaluable was when trying to find what was causing all units to crash when taken out of storage and powered up. ... Before anyone says ah, but that is a once in a lifetime situation, I've also managed to catch other "impossible" crashes in debuggers and demonstrate to people that it was actually the hardware doing something screwy. ... Sometimes I use a debugger to break the code at specific points and see what the state is because I am too lazy to add in the printf statements and rebuild. ...
    (comp.lang.c)