<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TamsPPC - the Windows Phone Blog &#187; Sample code</title>
	<atom:link href="http://tamsppc.tamoggemon.com/category/development/sample-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://tamsppc.tamoggemon.com</link>
	<description>The Windows Mobile news and opinion source</description>
	<lastBuildDate>Sun, 21 Mar 2010 09:33:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use C and C++ code together &#8211; undefined reference galore</title>
		<link>http://tamsppc.tamoggemon.com/2009/08/03/use-c-and-c-code-together-undefined-reference-galore/</link>
		<comments>http://tamsppc.tamoggemon.com/2009/08/03/use-c-and-c-code-together-undefined-reference-galore/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 03:59:17 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Sample code]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/?p=2386</guid>
		<description><![CDATA[If word on the street is to be believed, C and C++ can coexist peacefully. Just include the C library]]></description>
			<content:encoded><![CDATA[<p><img src="http://tamoggemon.com/blog/contents/2009/August/thacc++/c-and-c++-code.png" style="float: left; margin:5px;" title="Use C and C++ code together   undefined reference galore" alt="c and c++ code Use C and C++ code together   undefined reference galore" />If word on the street is to be believed, C and C++ can coexist peacefully. Just include the C library<'s header into your C++ file, put them both in a project as seen on the left, and you are set to go.</p>
<p>Unfortunately, this isn't the case - things like polymorphism and other properties of C++ lead to loads of "Undefined reference" errors when trying to access C functions from C++ code and vice versa.</p>
<p>The solution consist of special extern directives - the two sites below should keep you covered:<br />
<a href="http://developers.sun.com/solaris/articles/mixing.html">Mixing C and C++ code in the same program</a><br />
<a href="http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html">How to mix C and C++</a></p>
<p>Good luck porting!</p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2009/08/03/use-c-and-c-code-together-undefined-reference-galore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design patterns for .NET CF, courtesy of Microsoft</title>
		<link>http://tamsppc.tamoggemon.com/2008/12/28/design-patterns-for-net-cf-courtesy-of-microsoft/</link>
		<comments>http://tamsppc.tamoggemon.com/2008/12/28/design-patterns-for-net-cf-courtesy-of-microsoft/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 09:13:13 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Sample code]]></category>
		<category><![CDATA[UI design]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/?p=1384</guid>
		<description><![CDATA[Most books on design patterns and/or application architecture are insanely expensive and not particularly well-suited to the demands of mobile application developers.
Fortunately for us, Microsoft&#8217;s patterns &#038; practices group has just released a freely-downloadable ebook called &#8220;Rich Client Architecture Pocket Guide&#8221;. The 1MB PDF file looks at all things mobile &#8211; if you feel like [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://tamsppc.tamoggemon.com/contents/2008/December/thaapparch/Manhattan_night_view.jpg" style="float: left; margin:5px;" title="Design patterns for .NET CF, courtesy of Microsoft" alt="Manhattan night view Design patterns for .NET CF, courtesy of Microsoft" />Most books on design patterns and/or application architecture are insanely expensive and not particularly well-suited to the demands of mobile application developers.</p>
<p>Fortunately for us, Microsoft&#8217;s patterns &#038; practices group has just released a freely-downloadable ebook called &#8220;Rich Client Architecture Pocket Guide&#8221;. The 1MB PDF file looks at all things mobile &#8211; if you feel like giving it a spin, hit the URL below!</p>
<p><a href="http://www.codeplex.com/AppArch/Release/ProjectReleases.aspx?ReleaseId=19800">Rich Client Architecture Pocket Guide</a></p>
<p><i>Image: <a href="http://commons.wikimedia.org/wiki/File:Manhattan_night_view.jpg">Wikimedia Commons / Andyindia</a></i></p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2008/12/28/design-patterns-for-net-cf-courtesy-of-microsoft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TCHAR vs char &#8211; or &#8211; Windows String types made &#8220;easy&#8221;</title>
		<link>http://tamsppc.tamoggemon.com/2008/12/27/tchar-vs-char-or-windows-string-types-made-easy/</link>
		<comments>http://tamsppc.tamoggemon.com/2008/12/27/tchar-vs-char-or-windows-string-types-made-easy/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 15:47:49 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Sample code]]></category>
		<category><![CDATA[Tools / IDEs]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/?p=1380</guid>
		<description><![CDATA[.NET developers are blessed by not having to care about the joys of character representation on Win32-based platforms &#8211; while most other OSses (e.g. Palm OS) are limited to single-byte chars, our friends at M$&#8217;s have cooked up a variety of different types including Unicode.
One resource I personally found extremely useful was Michael Dunn&#8217;s two-part [...]]]></description>
			<content:encoded><![CDATA[<p>.NET developers are blessed by not having to care about the joys of character representation on Win32-based platforms &#8211; while most other OSses (e.g. Palm OS) are limited to single-byte chars, our friends at M$&#8217;s have cooked up a variety of different types including Unicode.</p>
<p>One resource I personally found extremely useful was Michael Dunn&#8217;s two-part tutorial. It starts by looking at the memory representation of &#8220;advanced&#8221; strings, and ends at string conversions &#8211; find it at CodeProject&#8217;s:<br />
<a href="http://www.codeproject.com/KB/string/cppstringguide1.aspx">The Complete Guide to C++ Strings, Part I &#8211; Win32 Character Encodings</a><br />
<a href="http://www.codeproject.com/KB/string/cppstringguide2.aspx">The Complete Guide to C++ Strings, Part II &#8211; String Wrapper Classes</a></p>
<p>Microsoft&#8217;s MSDN unfortunately is very confusing when it comes to strings. Nevertheless, the Win32&#8217;s String Chapter contains a few useful articles (hidden under UI&#8230;as if anyone would look there) &#8211; hit the URL below for the full scoop:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms776442(VS.85).aspx">Unicode in the Windows API</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2008/12/27/tchar-vs-char-or-windows-string-types-made-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uninstall CeRunAppAtEvent registrations when program is removed</title>
		<link>http://tamsppc.tamoggemon.com/2008/12/22/uninstall-cerunappatevent-registrations-when-program-is-removed/</link>
		<comments>http://tamsppc.tamoggemon.com/2008/12/22/uninstall-cerunappatevent-registrations-when-program-is-removed/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 10:33:50 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Sample code]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/?p=1351</guid>
		<description><![CDATA[So far, I have had huge issues with my beta testers: the moment they removed Daily Quote for PocketPC, their PocketPC popped up a highly annoying alert about &#8220;File not found&#8221; whenever it powered up. Yikes. I have no idea why Windows Mobile can&#8217;t purge unneeded notifications like the Palm OS can &#8211; but hey, [...]]]></description>
			<content:encoded><![CDATA[<p>So far, I have had huge issues with my beta testers: the moment they removed Daily Quote for PocketPC, their PocketPC popped up a highly annoying alert about &#8220;File not found&#8221; whenever it powered up. Yikes. I have no idea why Windows Mobile can&#8217;t purge unneeded notifications like the Palm OS can &#8211; but hey, its Windows Mobile&#8230;</p>
<p>The ideal solution would involve a single API call being called at program removal: as the program gets kicked off the handheld, a single call is called, thereby eliminating any and all notifications still lingering around. Unfortunately, this is not possible with the .NET CF &#8211; the solution is called <a href="http://msdn.microsoft.com/en-us/library/aa924308.aspx">Setup.dll</a> and requires native code. While I am completely dumbfounded as to why native code is required, the only reason I can think off is that Microsoft wants to make sure that the dll is run even if the .NET framework is not installed.</p>
<p>José Gallardo Salazar has posted a lovely overview of the process to his blog &#8211; hit the link below for the full scoop while I try to figure out how it all works:<br />
<a href="http://www.mobilepractices.com/2008/10/setupdll-sample-and-walkthrough-terms.html">http://www.mobilepractices.com/2008/10/setupdll-sample-and-walkthrough-terms.html</a></p>
<p>P.S. A template for a custom Setup.dll can be downloaded <a href="http://www.koushikdutta.com/2008/07/vc-project-template-for-smart-device-ce.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2008/12/22/uninstall-cerunappatevent-registrations-when-program-is-removed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ComboBox.FindString for .NET CF</title>
		<link>http://tamsppc.tamoggemon.com/2008/11/13/comboboxfindstring-for-net-cf/</link>
		<comments>http://tamsppc.tamoggemon.com/2008/11/13/comboboxfindstring-for-net-cf/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 13:49:47 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Sample code]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/?p=227</guid>
		<description><![CDATA[I often wonder what the Microsoft .NET CF team was smoking when it created the omission lists for the compact framework &#8211; many extremely useful calls were left out for some reason or the other (color picker, anyone?).
ComboBox objects usually contain a list of different unique strings &#8211; the little routine below implements the behaviour [...]]]></description>
			<content:encoded><![CDATA[<p>I often wonder what the Microsoft .NET CF team was smoking when it created the omission lists for the compact framework &#8211; many extremely useful calls were left out for some reason or the other (color picker, anyone?).</p>
<p>ComboBox objects usually contain a list of different unique strings &#8211; the little routine below implements the behaviour desktop developers find in the .FindString method:<br />
<code><br />
    Private Function findItem(ByVal cmb As System.Windows.Forms.ComboBox, ByVal text As String)<br />
        Dim index As Integer<br />
        For index = 0 To cmb.Items.Count - 1 'bc of weird beh<aviour of loop<br />
            index = index<br />
            If cmb.Items.Item(index).ToString = text Then<br />
                findItem = index<br />
                Exit Function<br />
            End If<br />
        Next<br />
        findItem = -1<br />
    End Function<br />
</code></p>
<p>As usual: feel free to do whatever you feel like with this code!</p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2008/11/13/comboboxfindstring-for-net-cf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android documentation &#8211; Plucker friendly</title>
		<link>http://tamsppc.tamoggemon.com/2008/10/19/android-documentation-plucker-friendly/</link>
		<comments>http://tamsppc.tamoggemon.com/2008/10/19/android-documentation-plucker-friendly/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 10:55:28 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Sample code]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/?p=951</guid>
		<description><![CDATA[Plucker is a classic and very useful documentation handler &#8211; I have generated a copy of the full Palm OS API reference years ago, and use it ever since. As Google&#8217;s Android developer documentation also comes as a bunch of HTML files, I felt that pluckering it may be useful.
Unfortunately, Plucker Desktop was not up [...]]]></description>
			<content:encoded><![CDATA[<p>Plucker is a classic and very useful documentation handler &#8211; I have generated a copy of the full Palm OS API reference years ago, and use it ever since. As Google&#8217;s Android developer documentation also comes as a bunch of HTML files, I felt that pluckering it may be useful.</p>
<p>Unfortunately, Plucker Desktop was not up to this gigantic task &#8211; after hours and hours of tweaking SunRise settings, I am proud to present the two shots below:<br />
<img src="http://tamoggemon.com/blog/contents/2008/October/thaandroid/androidC5204889.gif" title="Android documentation   Plucker friendly" alt="androidC5204889 Android documentation   Plucker friendly" /> <img src="http://tamoggemon.com/blog/contents/2008/October/thaandroid/androidC52048A0.gif" title="Android documentation   Plucker friendly" alt="androidC52048A0 Android documentation   Plucker friendly" /></p>
<p>These images show a Treo 680 rendering the Android Documentation via Plucker! The file is 18MB large and should IMHO be placed on your memory card rather than in your phone&#8217;s RAM.</p>
<p>Hit <a href="http://tamoggemon.com/blog/contents/2008/October/thaandroid/Documentation - Android.pdb">this link</a> to get the file!</p>
<p>P.S. Yes &#8211; this file really is a full pluck of Google Code&#8217;s /android/ folder&#8230;enjoy!</p>
<p>P.S.2 Use Vade Mecum to access Plucker files on your PocketPC!</p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2008/10/19/android-documentation-plucker-friendly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XPERIA X1 &#8211; Panel SDK released</title>
		<link>http://tamsppc.tamoggemon.com/2008/09/06/xperia-x1-panel-sdk-released/</link>
		<comments>http://tamsppc.tamoggemon.com/2008/09/06/xperia-x1-panel-sdk-released/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 23:07:16 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Emulators / Simulators]]></category>
		<category><![CDATA[Sample code]]></category>
		<category><![CDATA[Tools / IDEs]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/?p=679</guid>
		<description><![CDATA[Developers wanting to create panels that plug into Sony Ericsson&#8217;s &#8220;Sliding Panel homescreen&#8221; can now do so &#8211; the SDK has just been released. The requirements for the SDK are pretty humane &#8211; you need Visual Studio 2005, the WM6 SDK and the latest version of ActiveSync 4.5.
Unfortunately, Sony Ericsson does not specify which programming [...]]]></description>
			<content:encoded><![CDATA[<p>Developers wanting to create panels that plug into Sony Ericsson&#8217;s &#8220;Sliding Panel homescreen&#8221; can now do so &#8211; the SDK has just been released. The requirements for the SDK are pretty humane &#8211; you need Visual Studio 2005, the WM6 SDK and the latest version of ActiveSync 4.5.</p>
<p>Unfortunately, Sony Ericsson does not specify which programming language(s) can/must be used to create these panels &#8211; I am pretty sure that .NET CF developers will be left out due to the way-too-long startup time of the CLR interpreter (up to three seconds on my rx4240).</p>
<p>Amusingly, the SDK ships with a full XPERIA simulator &#8211; should anyone of you feel like taking the box for a spin: this is your opportunity&#8230;</p>
<p>Further information can be found at <a href="https://developer.sonyericsson.com/site/global/newsandevents/latestnews/newssept08/p_xperiapanels_sdkannouncement.jsp">Sony Ericsson&#8217;s developer network</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2008/09/06/xperia-x1-panel-sdk-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TouchFLO 3D &#8211; underlying technologies exposed to reveal open source stuff</title>
		<link>http://tamsppc.tamoggemon.com/2008/08/09/touchflo-3d-underlying-technologies-exposed-reveal-open-source-stuff/</link>
		<comments>http://tamsppc.tamoggemon.com/2008/08/09/touchflo-3d-underlying-technologies-exposed-reveal-open-source-stuff/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 13:48:34 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Sample code]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/?p=515</guid>
		<description><![CDATA[Like most other about screens, the about screen of HTC&#8217;s TouchFLO 3D app contains loads of gibberish that doesn&#8217;t really do anything except satisfy legal requirements. Enter Johan Sanneblad.
He took the time to &#8220;decompile&#8221; the text and found a stunning amount of open source projects which were used in the creation of HTC&#8217;s user interface.
People [...]]]></description>
			<content:encoded><![CDATA[<p>Like most other about screens, the about screen of HTC&#8217;s TouchFLO 3D app contains loads of gibberish that doesn&#8217;t really do anything except satisfy legal requirements. Enter Johan Sanneblad.</p>
<p>He took the time to &#8220;decompile&#8221; the text and found a stunning amount of open source projects which were used in the creation of HTC&#8217;s user interface.</p>
<p>People wishing for the full list can give Johan a click here:<br />
<a href="http://www.sanneblad.com/2008/08/05/touchflo-3d-technologies/">http://www.sanneblad.com/2008/08/05/touchflo-3d-technologies/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2008/08/09/touchflo-3d-underlying-technologies-exposed-reveal-open-source-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code reuse for Pocket PC and Smartphone</title>
		<link>http://tamsppc.tamoggemon.com/2008/02/13/code-reuse-for-pocket-pc-and-smartphone/</link>
		<comments>http://tamsppc.tamoggemon.com/2008/02/13/code-reuse-for-pocket-pc-and-smartphone/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 22:10:48 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Sample code]]></category>
		<category><![CDATA[Tools / IDEs]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/2008/02/13/code-reuse-for-pocket-pc-and-smartphone/</guid>
		<description><![CDATA[I am currently working on &#8220;porting&#8221; my VB.NET test application from Pocket PC to Windows Mobile Smartphone(two binaries, but one code base) and have found the following links very useful. Treat it as a &#8220;collection of resources&#8221; for now &#8211; a detailed writeup comes in the near future!
Share Source Code Across Platforms (Devices)
This article gives [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently working on &#8220;porting&#8221; my VB.NET test application from Pocket PC to Windows Mobile Smartphone(two binaries, but one code base) and have found the following links very useful. Treat it as a &#8220;collection of resources&#8221; for now &#8211; a detailed writeup comes in the near future!</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/ms180721(VS.80).aspx"><b>Share Source Code Across Platforms (Devices)</b></a><br />
This article gives you a broad overview at what&#8217;s needed.</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/ms180725(VS.80).aspx"><b>Verify Platform Support for Code in Device Projects</b></a><br />
A single line can kill your app &#8211; this article tells you how to tell the VB compiler to make sure that no &#8220;unedible&#8221; code is compiled.</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/ms180722(VS.80).aspx"><b>Change Platforms in Device Projects</b></a><br />
This little writeup tells you how to switch your Visual Studio between the two &#8220;platforms&#8221;&#8230;</p>
<p>If you find any other useful resources, please post them here!</p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2008/02/13/code-reuse-for-pocket-pc-and-smartphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Numeric text boxes with .NET CF</title>
		<link>http://tamsppc.tamoggemon.com/2008/02/09/create-numeric-text-boxes-with-net-cf/</link>
		<comments>http://tamsppc.tamoggemon.com/2008/02/09/create-numeric-text-boxes-with-net-cf/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 20:26:42 +0000</pubDate>
		<dc:creator>Tam Hanna</dc:creator>
				<category><![CDATA[Sample code]]></category>

		<guid isPermaLink="false">http://tamsppc.tamoggemon.com/2008/02/09/create-numeric-text-boxes-with-net-cf/</guid>
		<description><![CDATA[Sometimes, UI designs demand text boxen to accept only numeric data(aka no characters) &#8211; after all, entering abc as a delay time value most definitely won&#8217;t make much sense. While the Palm OS allows developers to create so-called &#8220;numeric text fields&#8221; that only accept numbers, the .NET CF does not include this feature&#8230;
The code below [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, UI designs demand text boxen to accept only numeric data(aka no characters) &#8211; after all, entering abc as a delay time value most definitely won&#8217;t make much sense. While the Palm OS allows developers to create so-called &#8220;numeric text fields&#8221; that only accept numbers, the .NET CF does not include this feature&#8230;</p>
<p>The code below restricts user input to the characters 1234567890 &#8211; no decimal points/commas can be entered:<br />
<code><br />
    Private Sub TxtX_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtX.KeyPress, TxtY.KeyPress<br />
        e.Handled = True<br />
        If Char.IsNumber(e.KeyChar.ToString) Then<br />
            e.Handled = False<br />
        End If<br />
    End Sub<br />
</code></p>
<p>Just paste it into the form&#8217;s code, and add the names of all numeric text boxen instead of TxtX and TxtY(you can have 1 to n).</p>
<p>Enjoy your numeric text box&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://tamsppc.tamoggemon.com/2008/02/09/create-numeric-text-boxes-with-net-cf/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
