I've been working on some old C++ code for Windows CE Today Screen Items. Adding orientation and resolution awareness to them. Debugging DLLs on CE has always been a major challenge but happily I've just discovered you can remotely debug today screen items. :o)
I'm assuming anyone who needs to step through a Today Item already knows how to create them using one of the many tutorials available from Microsoft or included in the Windows Mobile SDKs. Search for "memwatcher" if you're just getting started and you'll find what you need.
So you've setup the today screen registry entries and have copied the DLL to the correct location on the device. You go to the Today Control Panel and enable your device only to switch back and see it doesn't work. When I was Embedded Visual C++ I would scratch my head and play computer or perhaps implement a file logger or some sort of debugging hack. Visual Studio 2005 lets me attach to the process and step right through.
Make sure your today screen item is visible on the device and it is using the latest build so the debug files match up with the executable. Go to the Debug Menu, and choose "Attach to Process..." Change the Transport line from Default to Smart Device. Change the Qualifier drop down to the type of device you are using. If you haven't selected any devices lately you'll have to click the browse button and manually select your device type.
You'll see a list of processes running on your handheld, but only EXE processes can be attached to. Shell32 is the process that loads the today screen. If you are viewing the today screen it should say "Desktop" for the title.
Select the shell32.exe process and click Attach. Set a break point in the WM_PAINT handler of your today item click the start menu on the device. You should catch the WM_PAINT message the today menu invalidates your today item causing a refresh/redraw.
Joy! Now I can debug DeviceCaps and LogPixels without checking log files and swapping devices around.
I didn't plan in it but since everyone needs a blog to write a comment I may as well add my own. I've been considering doing something like this for years about coding but I've always been too busy actually writing software to write about writing software. :o)