views:

123

answers:

2

Hi, I am new in developing application for WinCE 5.0. I want to start from "Hello world" program or console application. But I couldn't find anything like that or any other sample applications to start from.

I am using Visual Studio 2005. I created new project >> visual C++ >> Win32 smart device project >> console application >> finish.

The project compiles fine. I was trying simple

printf("Hello world");

But When I ran in smart phone 2003 emulator, it showed no output.

I couldn't find a good tutorial to start from. Please suggest me some good tutorials or sample applications to start from.

Thanks in advance.

+2  A: 

What does the log say? That the application has terminated successfully with return code 0x0?

If you did not put anything to stop the application it might be that it runs good and terminates without you noticing it. Try to add a scanf or Sleep(5000) after the printf statement so things will be visible. You can also compile it in debug mode and put a breakpoint after the printf statement and see the results.

In addition, I am not too familiar with Windows Mobile and its incarnations (smart phone 2003 being one of them), but I am not sure how it handles a printf. You can try create an MFC application and use the MessageBox to display your text.


OK. I just tried the two options and there is no CMD windows in Windows Mobile (Smartphone or PocketPC) so the application runs successfully, but prints nothing.

Use the MFC option or deploy your application to a Windows CE 5.0 device emulator image. I have not tried that download myself, but it says that it should save you the hassle of handling Platform Builder. Note that you might be missing some components in the image down the road, but I suppose that for practicing purposes it should suite you just fine.

Shaihi
Yeah, it says- The program '[ada33b16] Second.exe' has exited with code 0 (0x0).I put scanf and it doesn't show anything. I am confused if printf , scanf works in the same way it works for PC.
Morison
Did you read my update? There is no console support in Windows Mobile so try to play with a MFC application or use the emulator. The functionality for `printf` and `scanf` under Windows CE is the same as under the desktop.
Shaihi
A: 

WinMo/Pocket pC devices have no console, so your output went nowhere. You can always add a console on like PocketConsole.

ctacke