coltsith

Hi there,

what's the best substitute for System.Console.Write() when developing mobile apps I've read that only works when developing console apps and it doesn't seem to work.

I'm using the Windows Mobile 6 emulator and Visual Studio 2005.

Thanks


Re: Device Emulator General System.Console.Write method for mobile application development? (Visual Studio 2005)

Christopher Fairbairn

Hi,

Can you give an example of the code you are using and explain how it is failing

The Windows Mobile platform does not provide (out of the box atleast) a command line/console interface. This means all applications must utilise a GUI to communicate with the user (so in the case of Compact Framework most likely using the functionality of the System.Windows.Forms namespace).

A Compact Framework application which uses Console.WriteLine() etc will execute on Windows Mobile (and Windows CE) devices, but will typically only be useful on Windows CE based devices which have a built in text console.

Third parties have released console addons for Windows Mobile which will allow you to interact with console based applications. For example Pocket Console - http://www.symbolictools.de/public/pocketconsole/index.htm . Microsoft has also released one as part of their Windows Mobile Developer Power Toys package available from http://www.microsoft.com/downloads/details.aspx FamilyID=74473fd6-1dcc-47aa-ab28-6a2b006edfe9&DisplayLang=en

However to the best of my knowledge both solutions don't operate correctly on Windows Mobile 6 (or even 5), so I know of no easy solution to this.

If all you want is to emit some debugging type statements during development, you may like to investigate the Debug and Trace classes within the System.Dignostics namespace. They will provide you with a semi similiar interface, but have the advantage that their output is routed in such a way that any debugger attached to your process is able to read them. Visual Studio hooks this output such that if you run your application from within Visual Studio's IDE the output will appear in the output pane of your desktop PC.

Sorry I can't be too helpful,

Christopher Fairbairn






Re: Device Emulator General System.Console.Write method for mobile application development? (Visual Studio 2005)

coltsith

Thanks for responding. I understand.

When you say output pane of the desktop pc, are you referring to the output window view in VS2005

Thanks again




Re: Device Emulator General System.Console.Write method for mobile application development? (Visual Studio 2005)

Christopher Fairbairn

Hi,

coltsith wrote:

When you say output pane of the desktop pc, are you referring to the output window view in VS2005

Yes, what ever output is sent to Debug.WriteLine (or Trace.WriteLine as the case may be) should appear within the output window of Visual Studio's IDE. It will be intermixed with the other output you see in there such as which assemblies have been loaded.

Of course this will only occur if the application is started (or attached to) via the Visual Studio IDE.

Hope it helps,

Christopher Fairbairn