<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-13472432</id><updated>2011-11-23T07:08:02.118-08:00</updated><category term='SqlCeCommand'/><category term='Visual Studio'/><category term='Compiler'/><category term='Off Topic'/><category term='Performance'/><category term='Desktop'/><category term='Location'/><category term='SQL'/><category term='Image'/><category term='SqlCeConnection'/><category term='Bug'/><category term='Windows Server 2008'/><category term='UI'/><category term='Scripting'/><category term='Today Screen'/><category term='Collections'/><category term='SqlCeParameter'/><category term='WM 5.0'/><category term='Tips/Tricks'/><category term='Signing'/><category term='P/Invoke'/><category term='Graphics'/><category term='C# vs. Java'/><category term='Camera'/><category term='Drawing'/><category term='Native'/><category term='Naming Conventions'/><category term='.NET CF 1.0'/><category term='Error'/><category term='Documentation'/><category term='strings'/><category term='Video'/><category term='Auto Start'/><category term='.NET 2.0'/><category term='SQL Server Mobile'/><category term='Startup'/><category term='Ambient'/><category term='SMS'/><category term='Audiovox SMT5600'/><category term='Gripes'/><category term='HTC'/><category term='Nullable Types'/><category term='Windows Mobile Device Center'/><category term='XDA'/><category term='Keyword'/><category term='Logging'/><category term='XML'/><category term='Platforms'/><category term='SystemState'/><category term='SDK'/><category term='SmartPhone Design'/><category term='Sets'/><category term='ListChanged'/><category term='Assembly'/><category term='DestroyWindow'/><category term='GPS'/><category term='ActiveSync'/><category term='Garbage Collection'/><category term='Bluetooth'/><category term='Cursor'/><category term='Exceptions'/><category term='GPRS'/><category term='Panels'/><category term='Installation'/><category term='.NET Micro Framework'/><category term='Context Aware'/><category term='Vista'/><category term='Performance Monitoring'/><category term='Limitation'/><category term='Designer'/><category term='Calendar'/><category term='CAB'/><category term='Date'/><category term='WM 6.1'/><category term='HashSets'/><category term='Wallpaper'/><category term='Threads'/><category term='Reset'/><category term='Security'/><category term='Splash Screen'/><category term='PowerToys'/><category term='Storage Card'/><category term='Configuration'/><category term='C++'/><category term='CameraCaptureDialog'/><category term='Registry Editor'/><category term='Constructs'/><category term='Audio'/><category term='SQL Compact Edition'/><category term='Links'/><category term='SIM'/><category term='TextBox'/><category term='Downloads'/><category term='WM 6.0'/><category term='OpenNETCF'/><category term='Transparency'/><category term='Emulator'/><category term='Sample'/><category term='Application Lock'/><category term='HttpWebRequest'/><category term='Controls'/><category term='SD'/><category term='Roam'/><category term='In The Hand'/><category term='Java'/><category term='Algorithms'/><category term='.NET 1.0'/><category term='Registry'/><category term='Phone'/><category term='MyExperience'/><category term='Open Source'/><category term='Timer'/><category term='Line Counting'/><category term='Properties'/><category term='.NET CF 2'/><category term='Tools'/><category term='Memory'/><category term='Singeltons'/><category term='Rant'/><category term='Appointment'/><category term='VS2005'/><category term='Enum'/><category term='Windows CE'/><category term='Enumerators'/><title type='text'>C# on the SmartPhone</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default?start-index=101&amp;max-results=100'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>144</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-13472432.post-5102842571534588690</id><published>2008-08-06T06:38:00.000-07:00</published><updated>2008-08-06T06:53:05.876-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='MyExperience'/><category scheme='http://www.blogger.com/atom/ns#' term='SqlCeParameter'/><category scheme='http://www.blogger.com/atom/ns#' term='SqlCeCommand'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>The Importance of SqlCeCommand.Parameters</title><content type='html'>One popular post on this blog discussed the reasoning behind the SqlCeCommand.Parameters functionality in the .NET SQL libraries. Since the &lt;a href="http://csharponphone.blogspot.com/2006/08/usage-of-sqlcecommandparameters.html"&gt;original post&lt;/a&gt; back almost two years ago (August 14th, 2006), I have used other SQL libraries in other languages including Java and Python. They also provide parameterized queries in addition to the traditional text based queries. Thus, this design is quite common.&lt;br /&gt;&lt;br /&gt;Although you might be tempted to write your queries using string.Format and SqlCeCommand.CommandText, it is much better to let the SQL library interpret your parameters automatically.  &lt;span style="font-size:100%;"&gt;Ilya Tumanov, a member of the &lt;a href="http://blogs.msdn.com/netcfteam/archive/category/11167.aspx"&gt;.NET Compact Framework Team&lt;/a&gt;, commented on my original post with a list of advantages that are worth repeating:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Yes, parameterized query is a preferred way. Benefits are:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  No need to create bunch of string objects all the time (in your code).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  No need to convert parameters from binaries to strings (in your code).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  No need to parse strings to get binaries back (in SQL CE).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;No locale/format specific issues as binary is format less and locale independent.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  No need to redo each command from scratch, prepared execution plan can be used with just different parameters.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  Works for all data types including binary/image.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Performance benefits from using parameters range from significant to really huge.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;The reasoning behind this post is to emphasize the red bullet point above. Recently, I have been receiving emails from users of &lt;a href="http://myexperience.sourceforge.net"&gt;the MyExperience tool&lt;/a&gt; who have tried to run the program on devices that are using non-English language versions of Windows Mobile. For the most part, MyExperience uses parameterized queries. I painstakingly went over every query a few years ago and made sure of that. Unfortunately, I missed a spot and this was the cause of the incompatibility.&lt;br /&gt;&lt;br /&gt;The offending query looked something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;sqlCmd.CommandText = string.Format("SELECT VersionId FROM Versions WHERE VersionName='{0}' AND VersionNumber='{1}' AND VersionModifiedDate='{2}'", vName, vNumber, vDate);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A keen reader may note that this query is region specific because it includes a DateTime object. The String.Format method was formatting the date based on the regional configuration of the device. This seemed to be incompatible with the date format that SQL Server Mobile was expecting. To fix this, I updated this code to read:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt;sqlCmd.CommandText = "SELECT VersionId FROM Versions WHERE VersionName=@VName AND VersionNumber=@VNumber AND VersionModifiedDate=@VModDate";&lt;br /&gt;sqlCmd.Parameters.Add("@VName", mev.VersionName);&lt;br /&gt;sqlCmd.Parameters.Add("@VNumber", mev.VersionNumber);&lt;br /&gt;sqlCmd.Parameters.Add("@VModDate", mev.ModificationDate);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thus, I kept the data in binary format which is, as Ilya pointed out, region/locale independent.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5102842571534588690?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5102842571534588690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5102842571534588690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5102842571534588690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5102842571534588690'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2008/08/importance-of-sqlcecommandparameters.html' title='The Importance of SqlCeCommand.Parameters'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-1612661473277086818</id><published>2008-08-05T16:25:00.000-07:00</published><updated>2008-08-05T16:32:59.692-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Error'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Operation Could Not Be Completed. Device Is Not Connected.</title><content type='html'>When attempting to debug one of my Windows Mobile applications this evening, I ran into this error:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color:#ff0000;"&gt;The operation could not be completed. The device is not connected.&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;The error occurred after I right clicked on a project in my solution and selected Debug-&gt;Start new instance. After a bit of Googling, I determined that the root cause of this message (in my case) was that my project was referring to content that was not actually on my local disk. Earlier in the day I had moved some XML files outside of the project directory, which my project still erroneously referred to. Once I deleted links to these files in my project, I was able to successfully debug my application.&lt;br /&gt;&lt;br /&gt;There is an msdn blog post about this &lt;a href="http://blogs.msdn.com/amit_chopra/archive/2007/08/09/the-operation-could-not-be-completed-the-device-is-not-connected-another-reason-for-this.aspx"&gt;here&lt;/a&gt;. Apparently, you may receive this error message for reasons beyond what I experienced above.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-1612661473277086818?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/1612661473277086818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=1612661473277086818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/1612661473277086818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/1612661473277086818'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2008/08/operation-could-not-be-completed-device.html' title='Operation Could Not Be Completed. Device Is Not Connected.'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-5041466777175041521</id><published>2008-07-06T09:59:00.000-07:00</published><updated>2008-07-07T03:00:09.508-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Compact Edition'/><category scheme='http://www.blogger.com/atom/ns#' term='Exceptions'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SqlCeEngine.Upgrade() causes SqlCeException "The operation completed successfully."</title><content type='html'>I am building a simple desktop-based command-line analysis tool for a set of .SDF files that were collected on various mobile devices for a research project. Unfortunately, I am having issues connecting to these .SDF files from my tool (each of which are stored locally on my desktop hard drive). The problem seems to be that the version of SQL Compact Edition used on the mobile devices is different from the one I have installed on my desktop.&lt;br /&gt;&lt;br /&gt;First, when connecting to one of the .SDF files from my desktop analysis tool, I receive the exception:&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;br /&gt;System.Data.SqlServerCe.SqlCeInvalidDatabaseFormatException was unhandled&lt;br /&gt;Message="The database file has been created by an earlier version of SQL Server Compact. Please upgrade using SqlCeEngine.Upgrade() method."&lt;br /&gt;Source="SQL Server Compact ADO.NET Data Provider"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I now catch this exception and call the recommended SqlCeEngine.Upgrade() method, so my code looks like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:85%;"&gt;SqlCeConnection sqlConnection = GetConnection(pathToDatabase);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;try&lt;br /&gt;{&lt;br /&gt;sqlConnection.Open();&lt;br /&gt;}&lt;br /&gt;catch (SqlCeInvalidDatabaseFormatException e)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine("The database " + pathToDatabase + " appears to be an old version, running Upgrade()");&lt;br /&gt;Stopwatch sw = Stopwatch.StartNew();&lt;br /&gt;SqlCeEngine sqlCeEngine = new SqlCeEngine(GetConnectionString(pathToDatabase));&lt;br /&gt;string newPathToDatabase = GetUpgradedDatabasePath(pathToDatabase);&lt;br /&gt;string newConnectionString = GetUpgradedConnectionString(pathToDatabase, newPathToDatabase);&lt;br /&gt;sqlCeEngine.Upgrade(newConnectionString);&lt;br /&gt;sw.Stop();&lt;br /&gt;Console.WriteLine("Upgraded the database in " + sw.ElapsedMilliseconds / 1000.0f + " secs");&lt;br /&gt;sqlConnection = GetConnection(newPathToDatabase);&lt;br /&gt;sqlConnection.Open();&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The SqlCeEngine.Upgrade() call takes about one minute, afterwards it throws a very confusing exception:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;System.Data.SqlServerCe.SqlCeException was unhandled&lt;br /&gt;Message="The operation completed successfully."&lt;br /&gt;Source="SQL Server Compact ADO.NET Data Provider"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_6c2szosoN6o/SHD8VoHYMbI/AAAAAAAAAzs/gYD-zQoMJwE/s1600-h/SqlCeException+Operation+Successful.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_6c2szosoN6o/SHD8VoHYMbI/AAAAAAAAAzs/gYD-zQoMJwE/s400/SqlCeException+Operation+Successful.png" alt="" id="BLOGGER_PHOTO_ID_5219949416598221234" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Figure 1: One of the most confusing exception messages I've ever received.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;At first I thought I should just catch this exception and carry on normally (as the exception says that the operation did indeed complete successfully); however, after some experimentation I noticed that the new, upgraded .SDF file built by the Upgrade() command is automatically deleted right before this exception is thrown so there is no upgraded .SDF file to connect to. Thus, it appears that the SqlCeException is valid but that the message is just wrong. I have attempted to use both the SqlCeEngine.Upgrade() call (which upgrades the database in place) and the SqlCeEngine.Upgrade(newConnectionString) call (which makes a new database). Both fail with the same exception.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_6c2szosoN6o/SHD8VyU3QwI/AAAAAAAAAz0/X_E5O1394I0/s1600-h/myexperience+upgrade+folder.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_6c2szosoN6o/SHD8VyU3QwI/AAAAAAAAAz0/X_E5O1394I0/s400/myexperience+upgrade+folder.png" alt="" id="BLOGGER_PHOTO_ID_5219949419339137794" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Figure 2: Note how the upgraded database appears in the filesystem momentarily before being automatically deleted just before the Upgrade() method throws an exception.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Any help here would be most appreciated. Has anyone else encountered this error? Note, I also posted this to the SQL CE newsgroup &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/browse_thread/thread/28e789aa63583855#"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update July 6th, 8:04PM:&lt;/span&gt; One workaround for this problem is to use the old v3.1 libraries in your desktop program. Thus, rather than use the .NET tab in the "Add Reference" dialog in Visual Studio, you would select "Browse" and then browse to the 3.1 libraries. For me, this is "C:\Program Files\Microsoft SQL Server Compact Edition\v3.1" Thankfully, Microsoft was smart enough to allow both sets of dlls on a machine (e.g., their 3.5 installation did not overwrite the 3.1 installation) as I also have a folder entitled "C:\Program Files\Microsoft SQL Server Compact Edition\v3.5" with the v3.5 libraries.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5041466777175041521?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5041466777175041521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5041466777175041521' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5041466777175041521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5041466777175041521'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2008/07/sqlceengineupgrade-causes.html' title='SqlCeEngine.Upgrade() causes SqlCeException &quot;The operation completed successfully.&quot;'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_6c2szosoN6o/SHD8VoHYMbI/AAAAAAAAAzs/gYD-zQoMJwE/s72-c/SqlCeException+Operation+Successful.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-2615933983473243248</id><published>2008-06-30T14:23:00.000-07:00</published><updated>2008-06-30T14:44:46.814-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Storage Card'/><category scheme='http://www.blogger.com/atom/ns#' term='P/Invoke'/><title type='text'>Storage Card Path Identification</title><content type='html'>I responded to a thread on Google Groups about the "correct" way to identify the Storage Card path on Windows Mobile devices back in February 2007 (&lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/e8c9310386be5ce6/df2c8d0490365d9d?lnk=st&amp;amp;q=FindFirstFlashCard+jonfroehlich#df2c8d0490365d9d"&gt;link&lt;/a&gt;). According to the Windows Mobile Team Blog, you should use FindFirstFlashCard (&lt;a href="http://blogs.msdn.com/windowsmobile/archive/2006/07/26/678742.aspx"&gt;link&lt;/a&gt;). I've used it successfully on a variety of HTC WM5 SmartPhone devices, however, this issue has recently cropped up as a (potential) issue for one of our &lt;a href="http://myexperience.sourceforge.net/"&gt;MyExperience &lt;/a&gt;tool users. The crux of the problem is that you cannot assume \Storage Card\ will be the default path for the storage or flash card on your Windows Mobile device, which is why FindFirstFlashCard is necessary. For example, on the Fujitsu LOOX PocketPC, the storage card path is \SD-MMCard\. The problem seems to be that either some device manufactuers don't properly support the FindFirstFlashCard method or that certain libraries on the device do not use FindFirstFlashCard and improperly assume the storage card is at \Storage Card\. More investigation is needed.&lt;br /&gt;&lt;br /&gt;The code I use in MyExperience (actually, the &lt;a href="http://www.sourceforge.net/projects/roam"&gt;Roam &lt;/a&gt;library which MyExperience relies on):&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:78%;"  &gt;public static String GetFirstFlashCardPath()&lt;br /&gt;{&lt;br /&gt;   Win32FindData win32FindData;&lt;br /&gt;   IntPtr intPtr = FindFirstFlashCard(out win32FindData);&lt;br /&gt;   String path = win32FindData.cFileName;&lt;br /&gt;   FindClose(intPtr);&lt;br /&gt;&lt;br /&gt;   if (String.IsNullOrEmpty(path))&lt;br /&gt;   {&lt;br /&gt;     throw new ResourceNotFoundException("&lt;br /&gt;      Could not find a flash card on this device");&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   return path;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The full code is available &lt;a href="http://roam.svn.sourceforge.net/viewvc/roam/Trunk/Source/Roam/Utils/StorageCardUtils.cs?revision=95&amp;amp;view=markup"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-2615933983473243248?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/2615933983473243248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=2615933983473243248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/2615933983473243248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/2615933983473243248'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2008/06/storage-card-path-identification.html' title='Storage Card Path Identification'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-7317420265163099750</id><published>2008-04-01T23:11:00.000-07:00</published><updated>2008-04-01T23:18:12.907-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Video'/><category scheme='http://www.blogger.com/atom/ns#' term='WM 6.1'/><title type='text'>Preview of Windows Mobile 6.1 Standard</title><content type='html'>There is a nice rundown of the new features in Windows Mobile 6.1 Standard (i.e., the WM flavor with no touch screen) on &lt;a href="http://pocketnow.com/index.php?a=portal_detail&amp;t=reviews&amp;id=1050"&gt;PocketNow&lt;/a&gt;, which includes screenshots and a video. The interface aesthetic is definitely improving but it's still no iPhone. Pocket IE still seems rather sluggish (though its &lt;a href="http://labs.live.com/deepfish/"&gt;Deepfish &lt;/a&gt;like zoom capability is long overdue). Perhaps WM7 will begin to treat the Internet as a fundamental part of the mobile experience (like the iPhone does) rather than an add-on or a way to access mail.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.pocketnow.com/html/portal/reviews/0000001050/review/img15.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.pocketnow.com/html/portal/reviews/0000001050/review/img15.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-7317420265163099750?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/7317420265163099750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=7317420265163099750' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7317420265163099750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7317420265163099750'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2008/04/preview-of-windows-mobile-61-standard.html' title='Preview of Windows Mobile 6.1 Standard'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-1030884668420044482</id><published>2008-03-06T15:31:00.001-08:00</published><updated>2008-03-06T15:40:44.738-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Mobile Device Center'/><category scheme='http://www.blogger.com/atom/ns#' term='Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Server 2008'/><title type='text'>Installing Windows Mobile Device Center on Windows Server 2008</title><content type='html'>I struggled for about an hour installing &lt;a href="http://www.microsoft.com/windowsmobile/devicecenter.mspx"&gt;Windows Mobile Device Center&lt;/a&gt; on Windows Server 2008. Here's so you don't have to:&lt;br /&gt;&lt;br /&gt;1. My &lt;a href="http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01330963&amp;amp;lc=en&amp;amp;cc=us&amp;amp;dlc=en&amp;amp;product=425745"&gt;first real lead&lt;/a&gt; was that Windows Mobile Device Center requires Windows Media Player to be installed. Yes, requires. How did I know that? Well, it certainly wasn't from this incredibly vague error message when running the WMDC installer: "&lt;span style="font-family:Courier;"&gt;The update could not be installed because at least one Windows component required by Windows Mobile Device Center is missing." &lt;/span&gt;Fortunately, I found a few links on the web talking about this, mainly this &lt;a href="http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01330963&amp;amp;lc=en&amp;amp;cc=us&amp;amp;dlc=en&amp;amp;product=425745"&gt;one&lt;/a&gt;.&lt;br /&gt;2. So, the key is adding Windows Media Player to Windows Server 2008; however, the download page for Windows Media Player doesn't include releases for Windows Vista much less Windows Server 2008. The key is to turn on the "Desktop Experience" of your Windows Server installation. Instructions on how to do that are &lt;a href="http://www.tech-recipes.com/rx/2576/windows_server_2008_install_desktop_experience_vista_theme"&gt;here&lt;/a&gt;.&lt;br /&gt;3. After reboot, you should be able to successfully install WMDC.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-1030884668420044482?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/1030884668420044482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=1030884668420044482' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/1030884668420044482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/1030884668420044482'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2008/03/installing-windows-mobile-device-center.html' title='Installing Windows Mobile Device Center on Windows Server 2008'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-8227119792112964320</id><published>2008-02-28T13:52:00.001-08:00</published><updated>2008-02-28T14:39:05.506-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActiveSync'/><title type='text'>Fixing a Gray ActiveSync</title><content type='html'>As a Windows Mobile developer, I typically work with multiple WM devices that I continuously plug in and out of our USB ports as I'm testing software. Sometimes, this confuses ActiveSync. For example, say my WM device is plugged into my desktop, ActiveSync is green. All is good. I unplug the phone to test something (e.g., GPS sensor) and walk around. Five minutes later, I stop the GPS software and plug my phone back into my desktop. However, now ActiveSync stays gray. Rather than restarting, which is what I usually do in this situation (though I hate restarting cause I usually have a 100 windows open), I do the following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Open ActiveSync and Task Manager.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;In Task Manager, click on the Applications tab. Select "Microsoft ActiveSync." Select "End Task."&lt;/li&gt;&lt;li&gt;Now click on the Processes tab. Select the "wcescomm.exe" and then press the "End Process" button. Do the same thing for "WCESMgr.exe" if it's there.&lt;/li&gt;&lt;li&gt;Unplug your device from the computer&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Go to Start Menu-&gt;All Programs and relaunch ActiveSync.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wait until ActiveSync starts and then plug your phone back in.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-8227119792112964320?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/8227119792112964320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=8227119792112964320' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8227119792112964320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8227119792112964320'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2008/02/fixing-gray-activesync.html' title='Fixing a Gray ActiveSync'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-5842713158787682985</id><published>2007-10-26T11:20:00.000-07:00</published><updated>2007-10-26T14:01:14.904-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Threads'/><category scheme='http://www.blogger.com/atom/ns#' term='SystemState'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 2'/><title type='text'>SystemState StateChanged Subscription Must Occur on UI Thread?</title><content type='html'>I &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/d915293183da22a7/2dce3fc9f4ffe060#2dce3fc9f4ffe060"&gt;posted the following&lt;/a&gt; to the &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework"&gt;.NET CF newsgroup&lt;/a&gt; this morning:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;The Microsoft.WindowsMobile.Status.SystemState class offers a great way to track a number of interesting and useful device system states (e.g., incoming phone calls, battery strength, etc.). However, recently I observed that the SystemState.Changed += new ChangeEventHandler(OnSystemStateChanged) subscription must be made from the UI thread. Has anyone else run into this? I attempted to write a console app that uses many of these system state notifications; however, none of the events were actually occurring. Once I switched to a form-based application, everything worked great.&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;Is this documented somewhere? If so, I couldn't find it. I am programming in .NET CF 2 for Windows Mobile 5.0 devices.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Chris Tacke &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/tree/browse_frm/thread/d915293183da22a7/2dce3fc9f4ffe060?rnum=1&amp;amp;_done=%2Fgroup%2Fmicrosoft.public.dotnet.framework.compactframework%2Fbrowse_frm%2Fthread%2Fd915293183da22a7%2F2dce3fc9f4ffe060%3F#doc_a3baa8055ddb1f32"&gt;responded&lt;/a&gt; with,&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Most of those events come from windows messages being posted at a low level  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;(FileSystemWatcher works int he same way too).  If you never call  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Application.Run, no message pump is ever created, so no windows messages are &lt;/span&gt;&lt;span style="font-style: italic;"&gt;ever dispatched. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;I don't think I've ever seen it documented, but if you walk through the &lt;/span&gt;&lt;span style="font-style: italic;"&gt;aygshell source code in Platform Builder (which a lot of these come from &lt;/span&gt;&lt;span style="font-style: italic;"&gt;eventually), you'll see that's how they work.  I agree that it's a poor &lt;/span&gt;&lt;span style="font-style: italic;"&gt;choice, but it's how it was implemented.  The workaround is a very long,  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;tedious process (again, we've done it for file system notifications)  of  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;reimplementing the entire listening system, creating a hidden window for &lt;/span&gt;&lt;span style="font-style: italic;"&gt;your app or implementing a Run() that doesn't take a Form (like we did in &lt;/span&gt;&lt;span style="font-style: italic;"&gt;the SDF). &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5842713158787682985?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5842713158787682985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5842713158787682985' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5842713158787682985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5842713158787682985'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/10/systemstate-statechanged-subscription.html' title='SystemState StateChanged Subscription Must Occur on UI Thread?'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-2597015726409770401</id><published>2007-10-25T09:13:00.000-07:00</published><updated>2007-10-25T09:22:34.219-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HttpWebRequest'/><category scheme='http://www.blogger.com/atom/ns#' term='Image'/><title type='text'>Image Download in .NET CF</title><content type='html'>Even though it seems more popular to use the WebClient class to download a single image or two, that class is not available on .NET CF. Nonetheless, it's easy enough with WebRequest and WebResponse.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;//grab icon&lt;br /&gt;Uri uri = new Uri("valid url to image&lt;insert valid="" url="" to="" img="" here=""&gt;");&lt;br /&gt;HttpWebRequest httpRequest = (HttpWebRequest)HttpWebRequest.Create(uri);&lt;br /&gt;HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();&lt;br /&gt;Stream imageStream = httpResponse.GetResponseStream();&lt;br /&gt;Bitmap buddyIcon = new Bitmap(imageStream);&lt;br /&gt;httpResponse.Close();&lt;br /&gt;imageStream.Close();&lt;br /&gt;&lt;br /&gt;//save icon as jpeg&lt;br /&gt;string iconFilePath = Path.Combine(FullContactsPath, contact.UserId + ".jpg");&lt;br /&gt;buddyIcon.Save(iconFilePath, ImageFormat.Jpeg);&lt;/insert&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-2597015726409770401?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/2597015726409770401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=2597015726409770401' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/2597015726409770401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/2597015726409770401'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/10/image-download-in-net-cf.html' title='Image Download in .NET CF'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-8253944874826095915</id><published>2007-10-02T23:15:00.001-07:00</published><updated>2007-10-02T23:18:20.642-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WM 5.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='PowerToys'/><title type='text'>Security Manager for WM5</title><content type='html'>Though the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7e92628c-d587-47e0-908b-09fee6ea517a&amp;amp;displaylang=en"&gt;Device Security Manager PowerToy for Windows Mobile 5.0&lt;/a&gt; has been available since June 6th, 2006, it's such an important application that it deserves mention even a year after its release. For one thing, it allows developers to easily bypass the incessant prompting that occurs every time a binary is changed and loaded on the device. And for two, it allows you as a developer to test different security policies on one device.&lt;br /&gt;&lt;br /&gt;The website says:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Device Security Manager helps developers test various security policies for Windows Mobile devices. It is designed as a desktop application that ships w ith a preset list of “security configurations”. A security configuration can be thought of as a template, which contains a collection of individual policies and settings. For example, a security configuration could define policies such as whether unsigned applications are allowed to execute, whether RAPI is disabled etc. Using this tool, the developer can provision a Windows Mobile device with different configurations, and then test the application’s behavior under these configurations. This tool can be used either on an emulator or an unlocked Windows Mobile device.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-8253944874826095915?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/8253944874826095915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=8253944874826095915' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8253944874826095915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8253944874826095915'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/10/security-manager-for-wm5.html' title='Security Manager for WM5'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-3474454915778595544</id><published>2007-09-11T00:04:00.001-07:00</published><updated>2007-09-11T08:44:48.116-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='P/Invoke'/><category scheme='http://www.blogger.com/atom/ns#' term='DestroyWindow'/><category scheme='http://www.blogger.com/atom/ns#' term='CameraCaptureDialog'/><category scheme='http://www.blogger.com/atom/ns#' term='Camera'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 2'/><title type='text'>Force Closing the CameraCaptureDialog</title><content type='html'>The camera API in .NET CF 2  offers a great improvement over .NET CF 1, which had no common interface to the device's camera (you needed to work with the OEM's directly to obtain a reference to their camera driver information). The &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.windowsmobile.forms.cameracapturedialog.aspx"&gt;CameraCaptureDialog&lt;/a&gt; class in .NET CF 2 can be used to capture still photographs or video (with or without audio) in a few lines of code. However, like many of the more "advanced" features in the .NET CF 2 library, not all of the OEMs have correctly implemented the managed camera functionality on their devices. For example, one &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_frm/thread/78b26e6de6c9c177/7b44a48fa2e07ac5?lnk=gst&amp;q=close+camera&amp;amp;rnum=3#7b44a48fa2e07ac5"&gt;common complaint on discussion boards&lt;/a&gt; is not being able to close the camera after invoking it with the CameraCaptureDialog.ShowDialog() method--CameraCaptureDialog.Dispose() does not work. Thus, on some devices, the camera application stays open sucking up memory and disturbing your window z-order even after calling Dispose().&lt;br /&gt;&lt;br /&gt;The code below provides a fix to this issue. It relies on a FindWindow P/Invoke to grab the handle to the device's camera application and a DestroyWindow P/Invoke to force it to close. Note that the Cingular 2125 device (which is where I tested this code) always appends [Photo] or [Video] to the camera title (no matter what title you set yourself). Thus, I have a function called GetCameraCaptureDialogTitle that appends that right suffix depending on the capture mode (e.g., video or photo).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;//Open the camera capture dialog&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;CameraCaptureDialog cameraCaptureDialog = new CameraCaptureDialog();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;string windowTitle = GetCameraCaptureDialogTitle(cameraCaptureDialog);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DialogResult dr = cameraCaptureDialog.ShowDialog();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if (dr == DialogResult.OK)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  string capturedFileName = cameraCaptureDialog.FileName;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  //do stuff with file!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;cameraCaptureDialog.Dispose();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;//sometimes the camera capture dialog does not close automatically&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;//we look for the window title and force close it ourselves&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;IntPtr ptr = WindowUtils.FindWindow(windowTitle);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Debug.WriteLine(string.Format("Found window '{0}' with ptr={1} ", windowTitle, ptr));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if (ptr != IntPtr.Zero)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  //force the camera closed&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  WindowUtils.DestroyWindow(ptr);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Here are the helper functions:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;private string GetCameraCaptureDialogTitle(CameraCaptureDialog dlg)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    if (&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;dlg&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;.Mode == CameraCaptureMode.Still)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      return string.Format("{0} [{1}]", &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;dlg&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;.Title, "Photo");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      return string.Format("{0} [{1}]", &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;dlg&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;.Title, "Video");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;[DllImport("coredll.dll", SetLastError = true)]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public static extern IntPtr DestroyWindow(IntPtr hWnd);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;[DllImport("coredll.dll", SetLastError = true)]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public static IntPtr FindWindow(string windowTitle)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    return FindWindow(null, windowTitle);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Please e-mail me or post a comment if you have any questions. Also, I use this trick in the MyExperience tool--the source for which can be found &lt;a href="http://sourceforge.net/projects/myexperience"&gt;here&lt;/a&gt; and is open sourced under the BSD license.&lt;br /&gt;&lt;br /&gt;Finally, moving beyond CameraCaptureDialog, it would be nice if .NET CF provided events for when a new image or video is captured on the device (e.g., a NewMediaCapturedEvent would be cool to have at the &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.windowsmobile.status.systemstate.aspx"&gt;SystemState&lt;/a&gt; level if not in the CameraCaptureDialog as well).  Furthermore, .NET CF 2 does not allow you to take images/video automatically without user intervention. This feature might be useful for taking timer-based pictures (e.g., for those times when you want to take a self/group portrait but have no one around to take the picture for you).  Marcus Perryman has C++ code that turns a Windows Mobile device into a wireless webcam using using DirectShow (see &lt;a href="http://blogs.msdn.com/marcpe/archive/2006/03/03/542941.aspx"&gt;this post&lt;/a&gt;). It would be cool to have this fully fleshed out in managed code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-3474454915778595544?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/3474454915778595544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=3474454915778595544' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/3474454915778595544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/3474454915778595544'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/09/force-closing-cameracapturedialog.html' title='Force Closing the CameraCaptureDialog'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-7256272641231777657</id><published>2007-08-16T15:27:00.000-07:00</published><updated>2007-08-16T15:45:53.675-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WM 5.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Storage Card'/><category scheme='http://www.blogger.com/atom/ns#' term='Memory'/><category scheme='http://www.blogger.com/atom/ns#' term='SD'/><title type='text'>WM5 Maximum Storage Card Capacity</title><content type='html'>Most of the Windows Mobile 5 devices that I've used including the T-Mobile MDA, SDA, and Cingular 2125 use miniSD flash storage. The Samsung Blackjack, however, uses microSD. With ever-increasing storage capacities available in these formats, I was curious if there was an upper capacity bound on WM5 devices. It looks like the internets are mixed on this one.&lt;br /&gt;&lt;br /&gt;This &lt;a href="http://blogs.msdn.com/windowsmobile/archive/2007/01/12/everything-you-want-to-know-about-sd.aspx"&gt;post&lt;/a&gt; by Mike Calligaro on the &lt;a href="http://blogs.msdn.com/windowsmobile/default.aspx"&gt;Windows Mobile blog&lt;/a&gt; points out that most cards and card readers available (at least on Jan 1st, 2007) follow the SD Spec 1.1, which maxes out at 2 gigabytes. Here's an excerpt,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;"Up to 2G, the only negative to larger storage cards is that they cost more. They don't burn any more power than smaller ones and they're not inherently any slower than smaller ones. I've used 2G cards in my Windows Mobile devices, and they work fine. Unfortunately, 4G and larger cards aren't likely to work yet.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Most cards and card readers out there follow the 1.1 version of the SD specification. That spec maxed out with 2G cards. There's a new 2.0 version of the spec that allows for larger cards, but Windows Mobile currently doesn't support SD 2.0. Even though we don't explicitly support SD 2.0, it's possible for our OEMs to add support themselves (I don't know if any have). So if you've got a Windows Mobile device that's able to read 4G SD cards, you don't have to call me a liar. Ignorant, yes. Liar, no."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://homepages.inspire.net.nz/~gambit/"&gt;Riki &lt;/a&gt;commented on this blog entry, however, and said:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;"The maximum capacity of SD card is 2GB under SD 1.1 of SD spec; however, by using FAT32, many SD 1.1 host devices can use 4GB SD cards. SD 1.0/1.1 uses traditional “Byte Addressing” scheme which limits the maximum capacity to 4GB while SD 2.0 adopts “Sector Addressing” scheme."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;So it looks like when purchasing new SD memory for a WM5 device, you should go with 2 gigabyte cards--those are guaranteed to work. However, some devices may support 4 gigabytes and up, especially if the OEM implemented the SD 2.0 Spec.&lt;br /&gt;&lt;br /&gt;On a related note,  &lt;a href="http://www.cs.washington.edu/homes/landay/"&gt;my advisor&lt;/a&gt; found two programs that turn a WM5 device into a USB SD reader. I haven't used either of these, so I cannot comment on them:&lt;br /&gt;&lt;a href="http://www.softick.com/pocket-pc/cardexport2/"&gt;http://www.softick.com/pocket-pc/cardexport2/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.modaco.com/WM5torage-t238545.html"&gt;http://www.modaco.com/WM5torage-t238545.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-7256272641231777657?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/7256272641231777657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=7256272641231777657' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7256272641231777657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7256272641231777657'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/08/wm5-maximum-storage-card-capacity.html' title='WM5 Maximum Storage Card Capacity'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-5360280643471121747</id><published>2007-07-22T14:22:00.000-07:00</published><updated>2007-07-25T00:05:00.538-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WM 5.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Context Aware'/><category scheme='http://www.blogger.com/atom/ns#' term='Configuration'/><category scheme='http://www.blogger.com/atom/ns#' term='GPS'/><category scheme='http://www.blogger.com/atom/ns#' term='Location'/><category scheme='http://www.blogger.com/atom/ns#' term='Bluetooth'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 2'/><title type='text'>Configuring the GPS Intermediate Driver</title><content type='html'>I recently purchased the &lt;a href="http://www.amazon.com/Qstarz-BT-Q818-32-Channel-Bluetooth-Receiver/dp/B000N763WE/ref=pd_bbs_sr_1/104-6560680-2316747?ie=UTF8&amp;s=electronics&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;qid=1185139450&amp;sr=8-1"&gt;QSTARZ Bluetooth GPS Receiver Model BT-Q818&lt;/a&gt; to play around with some location-aware research ideas I've had. First, the GPS receiver worked out-of-the-box after following the configuration instructions in the directions (or &lt;a href="http://blogs.msdn.com/windowsmobile/archive/2006/06/07/620387.aspx"&gt;see this post on the Windows Mobile team blog&lt;/a&gt;). I tested it both on my Cingular 2125 SmartPhone and Cingular 8125 Pocket PC Phone. Second, it works amazingly well with the new &lt;a href="http://mobile.search.live.com/about/"&gt;Windows Live Search&lt;/a&gt;--I can get smooth map scrolling, hybrid maps, and real time traffic overlays on my phone automatically centered on my current location. To configure Windows Live on WM to use GPS, open Live Search-&gt;Menu-&gt;Settings and then set the GPS COM port (in my case, COM6). Then, open Map and make sure that Menu-&gt;Center on GPS is checked.&lt;br /&gt;&lt;br /&gt;I was anxious to start my own hacking. I knew that Windows Mobile 5 shipped with the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms850332.aspx"&gt;GPS Intermediate Driver framework&lt;/a&gt;, unfortunately I did not realize that this is an unmanaged API. However,  both the Windows Mobile 5 SDK and the Windows MObile 6 SDK ship with sample code that provides a managed wrapper around that native GPS API. On my computer, these two samples can be found in:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;C:\Program Files\Windows Mobile 6 SDK\Samples\Smartphone\CS\GPS&lt;/li&gt;&lt;li&gt;C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\Cs\Gps&lt;/li&gt;&lt;/ol&gt;Unfortunately, neither of these samples worked for me immediately. I don't have a WM6 device, so I'll focus on the WM5 sample. The sample includes the Microsoft.WindowsMobile.Samples.Location GPS wrapper API and a small test app called GpsSample. To get the sample to work, you must configure the GPS Intermediate Driver, which requires either editing the registry or, alternatively, running the "GPS Intermediate Driver Control Panel." See &lt;a href="http://msdn2.microsoft.com/en-us/library/ms889543.aspx"&gt;Configuring the GPS Intermediate Driver&lt;/a&gt; on msdn. Well, where can I find this control panel? As the msdn link points out, many OEMs hide the application icon. On my Cingular 8125 Pocket PC Phone, this was certainly the case. Here's what I did to unhide it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;On the desktop, open Start-&gt;All Programs-&gt;Microsoft Visual Studio 2005-&gt;Visual Studio Remote Tools-&gt;Remote Registry Editor&lt;/li&gt;&lt;li&gt;Connect to your Windows Mobile device in the Remote Registry Editor&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Find the path: HKEY_LOCAL_MACHINE\ControlPanel\GPS Settings&lt;/li&gt;&lt;li&gt;Delete any "Redirect" or "Hide" keys under HKEY_LOCAL_MACHINE\ControlPanel\GPS Settings.&lt;/li&gt;&lt;/ol&gt;Then, on my Pocket PC device, I opened Settings-&gt;System and there was a GPS icon. Click on that icon and choose an unused COM port. This is the COM port that your GPS applications are going to communicate through--the GPS intermediate driver talks to the hardware directly and serves as a virtual device sending data out this COM port. I selected COM0. Then select the Hardware tab and choose the GPS hardware port. On my device, I setup GPS to communicate via COM6 (at the highest baud rate possible).  Then on the third and final tab ("Access"), make sure that Manage GPS Automatically is selected. After doing this, I reran the WM5 managed GPS sample and it worked great :)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6c2szosoN6o/RqPaWGTo4zI/AAAAAAAAAW4/i3YlOibpAQA/s1600-h/70722-152715-03.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_6c2szosoN6o/RqPaWGTo4zI/AAAAAAAAAW4/i3YlOibpAQA/s400/70722-152715-03.jpg" alt="" id="BLOGGER_PHOTO_ID_5090152077043753778" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;Successfully configured GPS Intermediate Driver on Pocket PC Phone&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Well, what if you have a SmartPhone? According to Jason Fuller on the Windows Mobile Team blog, the SmartPhone does not have the GPS Intermediate Driver Control Panel (see &lt;a href="http://blogs.msdn.com/windowsmobile/archive/2006/06/07/620387.aspx"&gt;his post here&lt;/a&gt;). You can, however, manually configure the GPS Driver by modifying the registry. Again, using the Remote Registry Editor found in the Visual Studio Remote Tools directory:&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6c2szosoN6o/RqPaWGTo4zI/AAAAAAAAAW4/i3YlOibpAQA/s1600-h/70722-152715-03.jpg"&gt;&lt;/a&gt;&lt;ol&gt;&lt;li&gt;[HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS Intermediate Driver] "IsEnabled"=dword:00000001&lt;/li&gt;&lt;li&gt;[HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS Intermediate Driver\Drivers]&lt;br /&gt;"CurrentDriver"="BT GPS"&lt;/li&gt;&lt;li&gt; [HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS Intermediate Driver\Drivers\BT GPS]&lt;br /&gt;"CommPort"="COM&lt;x&gt;X:" where X&lt;x&gt; = the hardware COM port (for me COM6)&lt;br /&gt;"FriendlyName"="BT GPS"&lt;br /&gt;"InterfaceType"="COMM"&lt;/x&gt;&lt;/x&gt;&lt;/li&gt;&lt;/ol&gt;See &lt;a href="http://forum.xda-developers.com/showthread.php?t=293018"&gt;this post&lt;/a&gt; on xda-developers for more information about modifying the registry to configure the GPS Intermediate Driver. Alternatively, someone has created a small tool to modify the registry settings--&lt;a href="http://forum.xda-developers.com/showthread.php?t=293397"&gt;run this&lt;/a&gt; from your SmartPhone. Here's the GpsSample running on my Windows Mobile 5 SmartPhone (Cingular 2125).&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_6c2szosoN6o/RqPaRGTo4yI/AAAAAAAAAWw/5vpIQulEnPk/s1600-h/70722-151121-01.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_6c2szosoN6o/RqPaRGTo4yI/AAAAAAAAAWw/5vpIQulEnPk/s400/70722-151121-01.jpg" alt="" id="BLOGGER_PHOTO_ID_5090151991144407842" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;Successfully configured GPS Intermediate Driver on SmartPhone&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Update 07/24/2007 11:58PM: &lt;/span&gt;Some have asked me to post further details on the registry settings I am using on the Pocket PC and SmartPhone. Here's a &lt;a href="http://abstract.cs.washington.edu/%7Ejfroehli/blog/WM5_GPS_Intermediate_Driver_Settings.pdf"&gt;PDF&lt;/a&gt; displaying screenshots of my key/value pairs related to the GPS Intermediate Driver.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5360280643471121747?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5360280643471121747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5360280643471121747' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5360280643471121747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5360280643471121747'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/07/configuring-gps-intermediate-driver.html' title='Configuring the GPS Intermediate Driver'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_6c2szosoN6o/RqPaWGTo4zI/AAAAAAAAAW4/i3YlOibpAQA/s72-c/70722-152715-03.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-8956730575594676840</id><published>2007-07-20T22:22:00.000-07:00</published><updated>2007-07-21T09:22:56.203-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sample'/><category scheme='http://www.blogger.com/atom/ns#' term='Wallpaper'/><category scheme='http://www.blogger.com/atom/ns#' term='Open Source'/><category scheme='http://www.blogger.com/atom/ns#' term='Downloads'/><category scheme='http://www.blogger.com/atom/ns#' term='Roam'/><category scheme='http://www.blogger.com/atom/ns#' term='Ambient'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 2'/><title type='text'>Wallpaper, Screenshots, and Application Switching</title><content type='html'>To get around some of the Today Screen API limitations (see &lt;a href="http://csharponphone.blogspot.com/2007/07/programming-today-screen-rant.html"&gt;this post&lt;/a&gt; for a Today Screen rant), I've played around quite a bit with programatically switching the wallpaper on a WM device. However, there a number of problems with this approach, most significantly: changing the device wallpaper is &lt;span style="font-style: italic;"&gt;slow&lt;/span&gt; and once the device has been signaled that the wallpaper has been updated, it does not actually redraw the wallpaper until the desktop is visible (e.g., the desktop is the top level window). For more about this issue, see my &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/tree/browse_frm/thread/45fc03552ed0e824/fee842c832d75be4?rnum=1&amp;q=sunil&amp;amp;_done=%2Fgroup%2Fmicrosoft.public.dotnet.framework.compactframework%2Fbrowse_frm%2Fthread%2F45fc03552ed0e824%2F2fdab2dc1306eb43%3Flnk%3Dgst%26q%3Dsunil%26rnum%3D4%26#doc_0dfc6446df9d088f"&gt;.NET CF newsgroup&lt;/a&gt; post. Nonetheless, changing the device wallpaper is one of the easiest ways to display ambient information.&lt;br /&gt;&lt;br /&gt;A project at Intel Research required that a screenshot be taken of a specified application, cropped, and displayed as the wallpaper on the device. However, as mentioned above, setting the wallpaper on a user's device can be an intrusive operation--not only can it take between 10-30 seconds but the wallpaper update does not actually happen until all applications are minimized making the desktop visible.&lt;br /&gt;&lt;br /&gt;I created a little test application which fulfills our requirements and attempts to avoid disrupting the user by waiting to execute until the device is idle. Here's how it works:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Waits for device idle&lt;/li&gt;&lt;li&gt;Finds handle to specified application (based on its window title)&lt;/li&gt;&lt;li&gt;Switches from current app to specified application (saving current foreground window handle)&lt;/li&gt;&lt;li&gt;Takes screenshot&lt;/li&gt;&lt;li&gt;Crops screenshot (if necessary)&lt;/li&gt;&lt;li&gt;Sets background wallpaper to screenshot&lt;/li&gt;&lt;li&gt;Minimizes all open applications so phone background refreshes&lt;/li&gt;&lt;li&gt;After background refresh, restores state of open applications&lt;/li&gt;&lt;li&gt;Returns to saved foreground window handle&lt;/li&gt;&lt;li&gt;Puts device back to sleep&lt;/li&gt;&lt;/ol&gt;Yes, it's hacky but I could think of no better way to do this. Note that in this case it was not possible to create a Today Screen plug-in.&lt;br /&gt;&lt;br /&gt;Download the &lt;a href="http://abstract.cs.washington.edu/%7Ejfroehli/blog/WallpaperChangerSource.zip"&gt;source code&lt;/a&gt; and the &lt;a href="http://abstract.cs.washington.edu/%7Ejfroehli/blog/WallpaperChangerBinary.zip"&gt;binary&lt;/a&gt;. You should be able to compile and deploy as long as you have the &lt;a href="http://www.opennetcf.com/cf/products/sdf.ocf"&gt;Smart Device Framework&lt;/a&gt; 2.0 from the OpenNETCF team installed. This sample will probably work with the SDF 2.1 as well but I haven't tested it. Alternatively, you can download the &lt;a href="http://abstract.cs.washington.edu/%7Ejfroehli/blog/WallpaperChangerBinary.zip"&gt;binary&lt;/a&gt; zip file and add those .dll references to the &lt;a href="http://abstract.cs.washington.edu/%7Ejfroehli/blog/WallpaperChangerSource.zip"&gt;source code&lt;/a&gt;  project. I've also added this sample code to the samples directory in Roam (see &lt;a href="http://www.sourceforge.net/projects/roam"&gt;SourceForge&lt;/a&gt;). Roam is a Windows Mobile open source library which provides functionality like a SQL connection pool, power management functions, and a whole slew of UI code.&lt;br /&gt;&lt;br /&gt;Note: this code has been tested on the Cingular 2125 and the T-Mobile SDA device. In addition, I also ran it on the Cingular 8125 Pocket PC Phone and everything worked except for the wallpaper changing code--this is because Roam's wallpaper changer methods only work on the SmartPhone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-8956730575594676840?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/8956730575594676840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=8956730575594676840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8956730575594676840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8956730575594676840'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/07/wallpaper-screenshots-and-application.html' title='Wallpaper, Screenshots, and Application Switching'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-8099858788889509649</id><published>2007-07-20T20:51:00.000-07:00</published><updated>2007-07-20T23:06:59.202-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rant'/><category scheme='http://www.blogger.com/atom/ns#' term='Today Screen'/><category scheme='http://www.blogger.com/atom/ns#' term='Ambient'/><title type='text'>Programming the Today Screen, A Rant</title><content type='html'>I find the Today Screen APIs (and lack thereof) to be one of the great failures in the design of the Windows Mobile framework. Many times in my mobile computing research, I have looked enviously at the Today Screen as prime real estate for ambient display of information and novel interactions. From an HCI perspective, it should be one of the most configurable components on the WM platform--it is, after all, a part of the display that the user glances at nearly every time they open/use their phone be it to check the time or simply to make a phone call. That is why, of course, Microsoft themselves include Today Screen plug-ins for calender information, text messages, emails. Microsoft has also recently recognized the value of ambient information on the desktop--Vista now ships with the Gadget Bar, which displays information about stocks, weather, email, traffic, etc. in an ambient manner.&lt;br /&gt;&lt;br /&gt;This same functionality should be available on WM. Unfortunately, not only are these plug-ins difficult to develop for Windows Mobile (e.g., they hook into a rather archaic Windows messaging scheme, cannot be C#/VB, and cannot easily be animated) they also require that the user modify their Today Screen settings by selecting a new configuration XML file. This latter point sounds harmless; however, it requires some effort to allow the user to maintain their current Today Screen look and feel with the addition of the new plug-in (even if this plug-in is a one line text output). They must copy over the XML into each of their existing Today Screen profiles--otherwise the plug-in will not be visible. I've seen some developers simply ship their plug-in with a fresh Today Screen XML file that is meant to overwrite the user's existing profile; however, unless the XML file has the exact same plug-ins specified, the user may miss out on a plugin they've previously installed (or a layout they've established via Settings-&gt;Home Screen-&gt;Home screen layout).&lt;br /&gt;&lt;br /&gt;Note: I speak only out of my own personal experience and watching others in my lab attempt to play around with Today Screen functionality. Though I haven't used WM6, it does not appear that this functionality has been improved with that release--perhaps WM7?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-8099858788889509649?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/8099858788889509649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=8099858788889509649' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8099858788889509649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8099858788889509649'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/07/programming-today-screen-rant.html' title='Programming the Today Screen, A Rant'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-680253065483958193</id><published>2007-06-02T13:06:00.000-07:00</published><updated>2007-06-26T22:47:51.483-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='P/Invoke'/><category scheme='http://www.blogger.com/atom/ns#' term='Timer'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 2'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Measuring Time on .NET CF 2</title><content type='html'>If you develop code on both the desktop with the full .NET and on the mobile platform with .NET CF, you have to be careful with the behavioral differences of some classes. DateTime is one such class. On the desktop, DateTime.Now is capable of 10 millisecond resolution (at least on WinXP and Vista). On the mobile platform, however, DateTime.Now only has a resolution of 1 second. Quite the difference if you're using DateTime.Now as an easy way to timestamp data. Note that this also includes the DateTime.Now.Ticks, which on the desktop is measured in 100-nanosecond units but is only at the 1-second level in Windows Mobile. So, what are the alternatives?&lt;br /&gt;&lt;br /&gt;The most straightforward method may be Environment.TickCount (which is different from DateTime.Ticks). Environment.TickCount represents a 32-bit signed integer containing the amount of time in milliseconds that has pass since the last time the computer was started.  The problem with TickCount, however, is that it is only a 32 bit value. Therefore, if the system runs continuously (e.g., no restarting) for 24.9 days the TickCount value will reach int.MaxValue and then wrap to int.MinValue, which is a negative value. Then, for the next 24.9 days, Environment.TickCount will increment from int.MinValue to 0 and start the cycle all over again.&lt;br /&gt;&lt;br /&gt;Alternatively, you can P/Invoke QueryPerformanceCounter and QueryPerformanceFrequency. The QueryPerformanceCounter  function retrieves the current value of the high-resolution performance counter, if one exists, on the computer. The QueryPerformanceFrequency function retrieves the frequency of the high-performance counter, if it exists. The frequency cannot change while the system is running. The frequency is also platform dependent. I'm not sure if any mobile device ships with a performance counter that offers higher resolution than Environment.TickCount but it is worth experimenting with. Here's what MSDN has to say about "high resolution timers"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;If a high-resolution performance counter exists on the system, you can use the QueryPerformanceFrequency function to express the frequency, in counts per second. The value of the count is processor dependent. On some processors, for example, the count might be the cycle rate of the processor clock. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The QueryPerformanceCounter function retrieves the current value of the high-resolution performance counter. By calling this function at the beginning and end of a section of code, an application essentially uses the counter as a high-resolution timer. For example, suppose that QueryPerformanceFrequency indicates that the frequency of the high-resolution performance counter is 50,000 counts per second. If the application calls QueryPerformanceCounter immediately before and immediately after the section of code to be timed, the counter values might be 1500 counts and 3500 counts, respectively. These values would indicate that .04 seconds (2000 counts) elapsed while the code executed&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here's the code to use the QueryPerformanceCounter in .NET CF 2 on Windows Mobile.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public static class&lt;/span&gt; PerformanceUtils&lt;br /&gt;{&lt;br /&gt;[DllImport(&lt;span style="color: rgb(102, 0, 0);"&gt;"coredll.dll"&lt;/span&gt;, EntryPoint = &lt;span style="color: rgb(102, 0, 0);"&gt;"QueryPerformanceCounter"&lt;/span&gt;)]&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;private static extern bool&lt;/span&gt; QueryPerformanceCounter(out long count);&lt;br /&gt;&lt;br /&gt;[DllImport(&lt;span style="color: rgb(102, 0, 0);"&gt;"coredll.dll"&lt;/span&gt;, EntryPoint = &lt;span style="color: rgb(102, 0, 0);"&gt;"QueryPerformanceFrequency"&lt;/span&gt;)]&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;private static extern bool&lt;/span&gt; QueryPerformanceFrequency(out long countsPerSecond);&lt;br /&gt;&lt;br /&gt;//these two variables are initialized in the PerformanceUtils static constructor&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public static readonly&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;long &lt;/span&gt;Frequency;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public static readonly&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;long &lt;/span&gt;FrequencyInMs;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;static &lt;/span&gt;PerformanceUtils()&lt;br /&gt;{&lt;br /&gt;if (QueryPerformanceFrequency(&lt;span style="color: rgb(51, 51, 255);"&gt;out &lt;/span&gt;Frequency) == false)&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt;throw new&lt;/span&gt; Exception(&lt;span style="color: rgb(153, 0, 0);"&gt;"The high resolution timer is not available on this device."&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;FrequencyInMs = Frequency / 1000;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public static long&lt;/span&gt; GetTimestampMs()&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;long &lt;/span&gt;count;&lt;br /&gt;QueryPerformanceCounter(out count);&lt;br /&gt;return (&lt;span style="color: rgb(51, 51, 255);"&gt;long&lt;/span&gt;)Math.Round(count / (&lt;span style="color: rgb(51, 51, 255);"&gt;double&lt;/span&gt;)FrequencyInMs);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; public static long&lt;/span&gt; GetPerformanceCount()&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;long &lt;/span&gt;count;&lt;br /&gt;QueryPerformanceCounter(&lt;span style="color: rgb(51, 51, 255);"&gt;out &lt;/span&gt;count);&lt;br /&gt;return count;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Update 06/07/2007 @ 1:45PM: &lt;/span&gt;Note that on a PocketPC the Environment.TickCount value is reset when you "soft or hard reset" the device. It is not reset when you suspend and resume (power off/on) the device. This is &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_frm/thread/c04ab6ed850018f3/03953e0e15ea3566?lnk=gst&amp;q=Environment.TickCount&amp;amp;rnum=3#03953e0e15ea3566"&gt;according to Ercan Turkarslan&lt;/a&gt; from  Microsoft Mobile Devices Developer Support. On a Pocket PC Phone or a SmartPhone, the Environment.TickCount value &lt;span style="font-style: italic;"&gt;is&lt;/span&gt; reset when you power off/on the device.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-680253065483958193?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/680253065483958193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=680253065483958193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/680253065483958193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/680253065483958193'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/06/measuring-time-on-net-cf-2.html' title='Measuring Time on .NET CF 2'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-5160005707078682337</id><published>2007-04-13T09:58:00.000-07:00</published><updated>2007-04-13T11:58:25.384-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenNETCF'/><category scheme='http://www.blogger.com/atom/ns#' term='Open Source'/><category scheme='http://www.blogger.com/atom/ns#' term='Roam'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><title type='text'>Announcing Roam</title><content type='html'>&lt;a href="http://sourceforge.net/projects/roam"&gt;Roam&lt;/a&gt; is a .NET CF 2 open source library for Windows Mobile devices that I've been developing off and on for the past year or so. A majority of the development has been driven off my own needs as a SmartPhone developer and &lt;a href="http://www.cs.washington.edu/homes/jfroehli"&gt;HCI researcher&lt;/a&gt;. Although the source code is hosted on SourceForge and released under the BSD license (&lt;a href="http://sourceforge.net/projects/roam"&gt;link&lt;/a&gt;), I have not had a chance to write a webpage or formal documentation. Thus, I've held off on advertising it on newsgroups/forums. I thought I would mention it here because I believe the source code could be of some use to my readers. Note that Roam requires OpenNETCF's &lt;a href="http://www.opennetcf.com/CompactFramework/Products/SmartDeviceFramework/tabid/65/Default.aspx"&gt;Smart Device Framework&lt;/a&gt; (SDF 2.0) library. They just recently released SDF 2.1, I'm not sure if Roam is compatible or not...&lt;br /&gt;&lt;br /&gt;Currently, the Roam library is broken down into four namespaces: Roam, Roam.Common, Roam.SqlCe, and Roam.UI. Each of these namespaces are compiled into their own assembly to save space.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Roam: &lt;/span&gt;contains media related functionality (e.g., sound player, camera media sniffer), pocket outlook related code (e.g., semi-robust SMS sending system), and low level device related utility classes (e.g., power notifications, storage card utilities, device id)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Roam.Common: &lt;/span&gt;contains code that is not-specific to Windows Mobile (i.e., this .dll also runs on the desktop). The largest subnamespace in this library is the Collections classes which include a HashSet, a Tree, a PriorityQueue, and a ReadOnlyHashtable among other things.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Roam.SqlCe: &lt;/span&gt;contains code relevant to SQL Server Mobile / Compact Edition. Currently, only two classes exist: SqlCeConnectionManager which offers thread safe connection pooling using a singleton paradigm and SqlCeWrapper which also offers thread safe access to the database by wrapping the SqlCeConnection object.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Roam.UI:&lt;/span&gt; this is the largest assembly in the Roam project. It contains many of the UI controls I've needed over the past year and were not included in .NET CF (e.g., scrollable label) I've developed a fairly simple drawing architecture that many of my custom UI classes use. Currently, Roam.UI contains custom controls for image buttons, radio list boxes, check box lists, key filtered lists, numeric text boxes and scrollable labels. In addition, Roam.UI features a set of utility classes that wrap P/Invoke calls to draw rounded rectangles, change the device's wallpaper, etc.&lt;/li&gt;&lt;/ol&gt;Below are two brief demos of Roam.UI custom controls: the TextBoxFilteredList and the ScrollableLabel. Note that the embedded videos below are hosted on YouTube which changes the aspect ratio and overall quality. :( The original source videos can be found &lt;a href="http://abstract.cs.washington.edu/%7Ejfroehli/blog/Roam-TextBoxFilteredList.avi"&gt;here&lt;/a&gt; and &lt;a href="http://abstract.cs.washington.edu/%7Ejfroehli/blog/Roam-ScrollableLabel.avi"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;object height="350" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/XmHJuQqAl6I"&gt;&lt;embed src="http://www.youtube.com/v/XmHJuQqAl6I" type="application/x-shockwave-flash" height="350" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;object height="350" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/_yFxU2mrXkc"&gt;&lt;embed src="http://www.youtube.com/v/_yFxU2mrXkc" type="application/x-shockwave-flash" height="350" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5160005707078682337?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5160005707078682337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5160005707078682337' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5160005707078682337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5160005707078682337'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/04/announcing-roam.html' title='Announcing Roam'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-5096280853946088553</id><published>2007-04-04T14:18:00.000-07:00</published><updated>2007-04-04T14:19:47.779-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WM 6.0'/><title type='text'>Deprecated Features In Windows Mobile 6</title><content type='html'>Channel9 Wiki has a list of deprecated API features in WM 6 that should no longer be used.&lt;br /&gt;&lt;br /&gt;(&lt;a href="http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.DeprecatedFeaturesInWindowsMobile6"&gt;link)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5096280853946088553?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5096280853946088553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5096280853946088553' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5096280853946088553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5096280853946088553'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/04/deprecated-features-in-windows-mobile-6.html' title='Deprecated Features In Windows Mobile 6'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-560025828764509705</id><published>2007-04-04T14:13:00.000-07:00</published><updated>2007-04-04T14:16:46.427-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WM 5.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Platforms'/><category scheme='http://www.blogger.com/atom/ns#' term='WM 6.0'/><title type='text'>Windows Mobile Platform Growth</title><content type='html'>A Microsoft developer posted about why he loves to work on Windows Mobile on the Windows Mobile Team Blog. In it he details the massive growth the Windows Mobile platform has experienced in the past few years:&lt;br /&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;I’ve talked a lot about not understanding marketers.  It’s even harder to understand accountants (even though I’m married to one…).  For some reason, our accountants think that the “year” starts in July and ends in June.  Well, in the first half of this “year” (in the accounting sense), we sold over five million phone units.  Last “year” we sold 150% more units than the year before.  And in &lt;em&gt;that&lt;/em&gt; year we sold 150% more units than the one before &lt;em&gt;it&lt;/em&gt;.  Weird accounting speak aside, we’ve been growing at 150% for a couple of years now.  That’s easy to do if you’re small.  But we’re not small.  Exciting times.&lt;/span&gt;&lt;/p&gt;(&lt;a href="http://blogs.msdn.com/windowsmobile/archive/2007/04/02/why-i-work-in-windows-mobile.aspx"&gt;link&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-560025828764509705?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/560025828764509705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=560025828764509705' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/560025828764509705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/560025828764509705'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/04/windows-mobile-platform-growth.html' title='Windows Mobile Platform Growth'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-2328265865724391631</id><published>2007-04-04T09:12:00.000-07:00</published><updated>2007-04-04T09:15:30.135-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Open Source'/><category scheme='http://www.blogger.com/atom/ns#' term='SMS'/><category scheme='http://www.blogger.com/atom/ns#' term='SDK'/><title type='text'>SMS Toolkit</title><content type='html'>A colleague pointed me to MSR India's &lt;a href="http://www.codeplex.com/smstoolkit"&gt;SMS Toolkit&lt;/a&gt;. I haven't had a chance to check it out but it looks very cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-2328265865724391631?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/2328265865724391631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=2328265865724391631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/2328265865724391631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/2328265865724391631'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/04/sms-toolkit.html' title='SMS Toolkit'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-4392999843445411098</id><published>2007-03-20T22:36:00.000-07:00</published><updated>2007-03-21T00:20:36.472-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Compiler'/><title type='text'>The Indexer Name</title><content type='html'>Any guesses why the following class won't compile?&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;  public class SuperSimpleIndexerClass&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);font-size:85%;" &gt;__&lt;/span&gt;&lt;span style="font-size:85%;"&gt;public double this[int index]&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;get { return 0; }&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;public double Item&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;{&lt;br /&gt;   &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;get { return 0; }&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;It has to do with the way indexers are internally represented in C#. By default, indexers have the name "Item." Thus, the indexer property and the explicit Item property will have a naming collision. We can fix this problem by providing the following attribute.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;  public class SuperSimpleIndexerClass&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(255, 255, 255);font-size:85%;" &gt;__&lt;/span&gt;&lt;span style="font-size:85%;"&gt;[System.Runtime.CompilerServices.IndexerName("TheItem")]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(255, 255, 255);font-size:85%;" &gt;__&lt;/span&gt;&lt;span style="font-size:85%;"&gt;public double this[int index]&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;get { return 0; }&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;public double Item&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;{&lt;br /&gt;   &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;get { return 0; }&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;__&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, this indexer will have the name TheItem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-4392999843445411098?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/4392999843445411098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=4392999843445411098' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4392999843445411098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4392999843445411098'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/03/indexer-name.html' title='The Indexer Name'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-8069518433845908991</id><published>2007-02-20T19:29:00.000-08:00</published><updated>2007-02-20T19:32:39.935-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows CE'/><category scheme='http://www.blogger.com/atom/ns#' term='WM 6.0'/><title type='text'>Windows Mobile 6 != Windows CE 6</title><content type='html'>Microsoft is once again attempting to clarify the difference between Windows Mobile and Windows CE. Sue Loh on the &lt;a href="http://blogs.msdn.com/ce_base/"&gt;Windows CE Base Team blog &lt;/a&gt;states: &lt;span style="font-style: italic;font-size:85%;" &gt;&lt;strong&gt;&lt;span style="color:blue;"&gt;&lt;br /&gt;&lt;br /&gt;Windows Mobile 6 does NOT run the CE 6 OS.&lt;/span&gt;&lt;/strong&gt;  Technically the OS version # in WM6 is 5.02; it's an advancement of the OS (5.01) that was in WM5.  Certain CE6 OS features have been ported to WM6.  But the kernel VM architecture we've been discussing here does NOT apply to Windows Mobile 6.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(&lt;a href="http://blogs.msdn.com/ce_base/archive/2007/02/14/windows-mobile-6-and-the-ce-os.aspx"&gt;link&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-8069518433845908991?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/8069518433845908991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=8069518433845908991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8069518433845908991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8069518433845908991'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/02/windows-mobile-6-windows-ce-6.html' title='Windows Mobile 6 != Windows CE 6'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-9192797705207351818</id><published>2007-02-18T17:04:00.000-08:00</published><updated>2007-02-18T17:29:25.031-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActiveSync'/><title type='text'>Oh No, Not Again, ActiveSync</title><content type='html'>My ActiveSync posts (e.g., &lt;span style="text-decoration: underline;"&gt;ActiveSync Sit &amp; Spin&lt;/span&gt;&lt;a href="http://csharponphone.blogspot.com/2006/05/activesync-41-sit-spin.html"&gt;&lt;/a&gt;) are the most visited blog entries on this site by nearly an order of magnitude. It's clear that many others have encountered the same problems as I. ActiveSync 4.5 beta, however, was working very well for me--in fact, flawlessly. So, perhaps I should not have been so eager to upgrade to the full release. Now, my current problem could be completely coincidental with my upgrade--I'd been running 4.5 for two straight days without experiencing a any problems. However, yesterday I plugged in my Cingular 2125 WM5 SmartPhone and a dialog box popped up that read "The software you are installing for this hardware: SmartPhone USB Sync has not passed Windows Logo testing to verify its compatibility with Windows XP." (see Figure 1 below)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_6c2szosoN6o/Rdj5n_xC__I/AAAAAAAAACs/zc8IJ5OH_lw/s1600-h/smartphone+usb+sync+error.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_6c2szosoN6o/Rdj5n_xC__I/AAAAAAAAACs/zc8IJ5OH_lw/s400/smartphone+usb+sync+error.PNG" alt="" id="BLOGGER_PHOTO_ID_5033047049113894898" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Figure 1: Windows Logo Testing Dialog&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;If you click "STOP Installation" the SmartPhone device will not be recognized by your computer; thus, you must press "Continue Anyway." In my two years of SmartPhone development, I have never seen this dialog (not sure if it is related to ActiveSync 4.5 or not). After selecting "Continue Anyway," ActiveSync opened and properly synchronized my SmartPhone. However, after unplugging the phone and plugging it in again, I received another dialog box--this one was a bit more alarming: "One of the USB devices attached to this computer has malfunctioned, and Windows does not recognize it." (see Figure 2 below)&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_6c2szosoN6o/Rdj7AfxDAAI/AAAAAAAAAC0/xwU_1e6MJig/s1600-h/usb+error.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_6c2szosoN6o/Rdj7AfxDAAI/AAAAAAAAAC0/xwU_1e6MJig/s400/usb+error.PNG" alt="" id="BLOGGER_PHOTO_ID_5033048569532317698" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Figure 2: USB Device Not Recognized&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;After this point, no amount of restarting (either my computer or device) would fix this issue. I'm not sure if Figure 2 is related to Figure 1 at all, but it seems likely. Interestingly, my other WM5 device (a Pocket PC Phone) still synchronized fine.&lt;br /&gt;&lt;br /&gt;I was able to fix the problem by:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Unplugging device from computer&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Uninstalling ActiveSync 4.5&lt;/li&gt;&lt;li&gt;Restarting Computer&lt;/li&gt;&lt;li&gt;Reinstalling Activesync 4.5&lt;/li&gt;&lt;li&gt;Plugging device back in&lt;/li&gt;&lt;/ol&gt;Unfortunately, it only took me about three hours to get this right. Troubleshooting included a hard reset on my SmartPhone, thus losing all of my installed programs of which there are many. I don't believe the problem is on the device side, however, so a hard reset is probably not required (in fact, after my hard reset, plugging in my device would still cause the Figure 2 dialog to pop up).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-9192797705207351818?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/9192797705207351818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=9192797705207351818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/9192797705207351818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/9192797705207351818'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/02/oh-no-not-again-activesync.html' title='Oh No, Not Again, ActiveSync'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_6c2szosoN6o/Rdj5n_xC__I/AAAAAAAAACs/zc8IJ5OH_lw/s72-c/smartphone+usb+sync+error.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-767629468255048167</id><published>2007-02-15T16:03:00.000-08:00</published><updated>2007-02-15T20:20:54.207-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActiveSync'/><title type='text'>ActiveSync 4.5 Released</title><content type='html'>You can download ActiveSync 4.5 &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9e641c34-6f7f-404d-a04b-dc09f8141141&amp;DisplayLang=en"&gt;here&lt;/a&gt;.  The readme.doc includes an overview of new features, a select few are below.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Feature&lt;/span&gt;: A device can stay connected to cellular and wireless networks while also connected to PC.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Benefit: Enables the device to receive incoming VoIP calls and MMS messages when it is connected to a PC.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Feature&lt;/span&gt;: An integrated troubleshooter utility is included.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Benefit: The utility scans your PC and device to identify problems that can affect the use of your device with the PC.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Feature&lt;/span&gt;: Overall stability has been improved.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Benefit: Enhances the reliability of connecting devices and syncing.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Feature&lt;/span&gt;: USB support has been improved.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Benefit: ActiveSync 4.5 provides the fastest USB transport between your PC and your mobile device to date.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;There's also a plethora of exchange related features, but I don't use those so I'm not sure how useful they are.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-767629468255048167?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/767629468255048167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=767629468255048167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/767629468255048167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/767629468255048167'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/02/activesync-45-released.html' title='ActiveSync 4.5 Released'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-8891531710295172595</id><published>2007-02-13T14:00:00.000-08:00</published><updated>2007-02-15T20:24:16.359-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WM 6.0'/><title type='text'>What's New in Windows Mobile 6</title><content type='html'>Jim Wilson has posted an article "What's New for Developers in Windows Mobile 6" on msdn (&lt;a href="http://msdn2.microsoft.com/en-us/library/bb278115.aspx"&gt;link&lt;/a&gt;). Note that the difference between WM 5 and WM 6 is much less substantial than the difference between WM 2003 (WM4) and WM5. This is, in part, more due to the transition between .NET CF 1 and .NET CF 2 imo. Nonetheless, Here is a quick summary of the new WM 6 features I'm most interested in:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;The .NET Compact Framework 2.0 Service Pack 1 (SP1) and Microsoft SQL Server™ 2005 Compact Edition are in the ROM of all Windows Mobile 6 devices, which allows your application to use .NET Compact Framework 2.0 and SQL Server 2005 Compact Edition without needing to distribute or install either product on the user's device. This reduces the time and cost of application deployment resulting in direct monetary savings.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is absolutely fantastic. Most of the work I do currently utilizes both .NET CF 2 SP1 and SQL Server 2005 Compact Edition (used to be called SQL Server 2005 Mobile Edition). By shipping with these binaries in the ROM, this greatly simplifies deployment/installation.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;An improved Device Emulator with many new features that allows you to test your applications across a wider range of device form factors without needing to purchase the device. This includes a cellular emulator and a GPS emulator&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;A newly added lightweight version of the Tablet PC's inking API, Wireless Internet Service Provider (WISP), allows you to incorporate ink-based features into your applications running on Windows Mobile 6 Professional and Windows Mobile 6 Classic devices.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="sectionToggle5"&gt;In addition to the more than 100 State and Notification Broker state values supported by Windows Mobile 5.0, Windows Mobile 6 adds several more. Windows Mobile 6 provides call state information for Voice over Internet Protocol (VoIP) phone calls including the phone number, operator name, and more. Windows Mobile 6 also adds state information for device locking. State information is now available for changes in the keypad lock state, device lock state, and SIM lock state.&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Update 02-15-2007: &lt;/span&gt;According to &lt;a href="http://blogs.msdn.com/windowsmobile/archive/2007/02/14/where-are-the-windows-mobile-6-sdks.aspx"&gt;this post&lt;/a&gt; on the &lt;a href="http://blogs.msdn.com/windowsmobile/"&gt;Windows Mobile Team Blog&lt;/a&gt;, the Windows Mobile 6 SDK won't be out until March 1st with a "refreshed" version on May 1st.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-8891531710295172595?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/8891531710295172595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=8891531710295172595' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8891531710295172595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8891531710295172595'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/02/whats-new-in-windows-mobile-6.html' title='What&apos;s New in Windows Mobile 6'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-5277573746320254968</id><published>2007-01-11T18:07:00.000-08:00</published><updated>2008-08-07T03:34:05.096-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='Threads'/><category scheme='http://www.blogger.com/atom/ns#' term='SqlCeConnection'/><title type='text'>Keeping SqlCeConnection Open and Thread Safety</title><content type='html'>I've done quite a bit of searching online and it's fairly clear that there is a bit of confusion about how one should use the SqlCeConnection object, particularly with regards to two interrelated issues: (1) whether to keep the SqlCeConnection open and (2) whether the SqlCeConnection is thread safe. For example, some people advocate for keeping one static SqlCeConnection open and shared for the lifetime of an application. However, if the application is multithreaded, can we assume that we can safely share the connection object? I've blogged about this once before &lt;a href="http://csharponphone.blogspot.com/2006/04/sqlceconnection-keep-connection-open.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I think some of this confusion stems from the differences between the desktop version of SQL Server (SqlConnection) and SQL Server Mobile (SqlCeConnection). For example, in a MSDN &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=526164&amp;amp;SiteID=1"&gt;forum post&lt;/a&gt;, Dave Hayden (a .NET/C# MS MVP) suggests that "For 99% of all applications, the best practice is to open and dispose of database connections right when you need them and not to leave them open for the duration of the application. Open the database connection as late as possible and close/dispose of it as soon as possible." If, like Dave recommends, we always open a local connection within our method calls (and do not access the SQL connection as a state object), we don't really have to worry about the thread safety of the SQL connection object.&lt;br /&gt;&lt;br /&gt;Although this may be good advice for accessing SQL Server from the desktop, it contradicts the advice given by Microsoft developer Marcus Perryman in his &lt;a href="http://blogs.msdn.com/marcpe/archive/2005/06/21/431074.aspx"&gt;SQL Mobile post on his blog&lt;/a&gt;, "The SqlCeConnection class implements the IDisposable interface because it allocates a number of unmanaged resources, and therefore the code must call Dispose() on the object before it goes out of scope to ensure these resources are cleaned up in a timely manner. Creating and destroying SQL Mobile database connections is an expensive task and so the SqlCeConnection is designed to be a long lived, shared instance across the lifetime of the application.".&lt;br /&gt;&lt;br /&gt;Thus, it appears that Dave and Marcus contradict each other. However, Dave's advice was (I believe) given under the assumption that the person was using SQL Server and not SQL Server Mobile. So, it looks like the correct usage of the SqlCeConnection object is to reduce the amount of creating and destroying SQL Mobile database connections (the reasoning behind this is that SQL Server Mobile supposedly does not have connection pooling, see Marcus Perry link above).&lt;br /&gt;&lt;br /&gt;So, then what about thread safety? The MSDN documentation is clear. Most objects within the SQL Mobile namespace are not threadsafe. For example, the SqlCeConnection documentation states, "Any public static members of this type are thread safe. Any instance members are not guaranteed to be thread safe." Thus, instance methods like BeginTransaction(), CreateCommand(), etc. are not thread safe. I'm not sure what the detriment/exception would be if this was not followed, but MSDN is clear, SqlCeConnection was not meant to be shared across threads.&lt;br /&gt;&lt;br /&gt;OK, so what if you have a multithreaded application? It seems like there are two prevailing methods: (1) Marcus Perry suggests that "for a complex app, ideally the SqlCeConnection instance would be placed in a singleton wrapper class that manages access to the database." or (2) Ginny Caughey (MS MVP) offers the other approach, using a separate SqlCeConnection object for each thread. For the first approach, I would imagine the simplest wrapper possible may look something like the following (I will implement it as a static class rather than a singleton):&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;static class SqlWrapper&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;private static SqlCeConnection _sqlCeConnection;&lt;br /&gt;private static object _objLock = new object();&lt;br /&gt;&lt;br /&gt;static void Open(string connectionString)&lt;br /&gt;{&lt;br /&gt;lock (_objLock)&lt;br /&gt;{&lt;br /&gt;if (_sqlCeConnection != null)&lt;br /&gt;  throw new InvalidOperationException("Connection already open.");&lt;br /&gt;_sqlCeConnection = new SqlCeConnection(connectionString);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void Close()&lt;br /&gt;{&lt;br /&gt;lock (_objLock)&lt;br /&gt;{&lt;br /&gt;if (_sqlCeConnection != null)&lt;br /&gt;{&lt;br /&gt;  _sqlCeConnection.Dispose();&lt;br /&gt;  _sqlCeConnection = null;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static int ExecuteNonQuery(SqlCeCommand sqlCommand)&lt;br /&gt;{&lt;br /&gt;lock (_objLock)&lt;br /&gt;{&lt;br /&gt;sqlCommand.Connection = _sqlCeConnection;&lt;br /&gt;return sqlCommand.ExecuteNonQuery();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static SqlCeDataReader ExecuteReader(SqlCeCommand sqlCommand)&lt;br /&gt;{&lt;br /&gt;lock (_objLock)&lt;br /&gt;{&lt;br /&gt;sqlCommand.Connection = _sqlCeConnection;&lt;br /&gt;return sqlCommand.ExecuteReader();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Does this seem right to people? In this class, we do not expose the underlying SqlCeConnection object, thus commands must be passed in via the wrapper interface to be executed (as they require a reference to a SqlCeConnection).&lt;br /&gt;&lt;br /&gt;For the second approach, one connection per thread, the difficulty isn't necessarily in opening 1 connection per thread but knowing when to close those connections. In other words, a SqlCeConnectionManager class might manage access to SqlCeConnections and might serve as a SqlCeConnection factory (with, perhaps, an underlying connection pool). The factory may look at which thread is active (Thread.CurrentThread), check to see if a connection has been allocated for that thread (create one if not) and return the SqlCeConnection. However, the onus would be on the threads themselves to close their connections before exiting (this seems messy to me). I suppose one could spawn a monitoring thread that looked as the status of Threads and, once dead, would either close the respective SqlCeConnection or return the connection the connection pool. However, .NET CF 2.0 does not support the instance property IsAlive so it's not clear how one could do this.&lt;br /&gt;&lt;br /&gt;I would imagine that a multithreaded application that launches many short-lived threads that need database access should probably go with the SQL wrapper solution as the overhead of opening/closing connections would introduce a performance hit (even with connection pooling).&lt;br /&gt;&lt;br /&gt;An interesting side note: I created a test app on the mobile phone which launched 50 threads on a shared SqlCeConnection and proceeded to read/write random bits of data. No exception was thrown. Of course, the lack of error does not mean that it will always work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5277573746320254968?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5277573746320254968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5277573746320254968' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5277573746320254968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5277573746320254968'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/01/keeping-sqlceconnection-open-and-thread.html' title='Keeping SqlCeConnection Open and Thread Safety'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-4767246166554401326</id><published>2007-01-11T00:22:00.000-08:00</published><updated>2007-01-30T22:10:50.906-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Threads'/><category scheme='http://www.blogger.com/atom/ns#' term='Controls'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><title type='text'>Get Control From Handle</title><content type='html'>I have not yet determined a clean way to invoke code on the UI thread without access to a Form/Control. The Process class has a property called "MainWindowHandle," which returns the window handle of the main window of the associated process. So, for example, Process.GetCurrentProcess().MainWindowHandle would return a Handle (HWND) to the main window. But how can we translate a window handle to a Form?&lt;br /&gt;&lt;br /&gt;In .NET 2.0, this is relatively easy, we can simply call Control.FromHandle(IntPtr handle). Thus, receiving access to the main window is simply:&lt;br /&gt;(Form)Control.FromHandle(Process.GetCurrentProcess().MainWindowHandle)&lt;br /&gt;&lt;br /&gt;Unfortunately, however, .NET CF 2.0 does not expose the Control.FromHandle method. I have not found anyone on the web who has solved this problem. A few relevant links:&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.general/tree/browse_frm/thread/c65f0b7d652c3c3d/07abf6bf8456ed87?rnum=1&amp;hl=en&amp;amp;q=Get+MainForm&amp;_done=%2Fgroup%2Fmicrosoft.public.dotnet.general%2Fbrowse_frm%2Fthread%2Fc65f0b7d652c3c3d%2F5816d7083737d0cf%3Flnk%3Dst%26q%3DGet+MainForm%26rnum%3D9%26hl%3Den%26#doc_71309e0c94946254"&gt;How do I get System.Control object from a Win32 Handle?&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/search?hl=en&amp;amp;group=microsoft.public.dotnet.framework.compactframework&amp;q=FromHandle&amp;amp;amp;amp;qt_g=1&amp;searchnow=Search+this+group"&gt;Google Groups.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Given the limitations of CF, one hacky way to do this would be to expose a static property on your MainForm class which would return a reference to itself. This would actually work in my case as the MainForm should not be instantiated more than once.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Update 01/30/2007&lt;/span&gt;: I just made a post to Google Groups about this (&lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_frm/thread/f9511ee876a10f5e/3581424d1cd010d2#3581424d1cd010d2"&gt;link&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-4767246166554401326?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/4767246166554401326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=4767246166554401326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4767246166554401326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4767246166554401326'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2007/01/get-control-from-handle.html' title='Get Control From Handle'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-5805400139429040952</id><published>2006-12-20T10:51:00.001-08:00</published><updated>2006-12-21T15:30:27.618-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='P/Invoke'/><category scheme='http://www.blogger.com/atom/ns#' term='Graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='Transparency'/><title type='text'>Alpha Blending on SmartPhone</title><content type='html'>I created a quick test app to experiment with the performance of the P/Invoke AlphaBlend calls as discussed in &lt;a href="http://blogs.msdn.com/chrislorton/archive/2006/04/07/570649.aspx"&gt;this blog post&lt;/a&gt; by Chris Lorton. The AlphaBlend native call does not support per-pixel alpha blending so the alpha value is specified for the entire image. The "incr" label in these two videos is the step value for the alpha channel used in the animation. The frame rates were better than expected, right around 17-20fps.&lt;br /&gt;&lt;br /&gt;The tool I am using to record the video is called &lt;a href="http://ateksoft.com/featuresSC.html"&gt;CoolCapture &lt;/a&gt;(I'm using the trial version here). It's very cool. It's essentially a fully featured screen capture tool for Windows Mobile 5 devices. You can generate both videos or pictures. I was fairly impressed with the performance as well; capturing these two videos below only resulted in about a ~6 fps reduction in my animation (thus the blending doesn't look as smooth as it actually is). The trial version limits the recording interval to ~10 seconds (though the webpage says 5 seconds).&lt;br /&gt;&lt;br /&gt;Note that the capture resolution was 240x320 (the device resolution); however, this was automatically changed to 640x480 when I uploaded the video to YouTube. This is why the videos have that stretched out look.&lt;br /&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;object height="350" width="425"&gt;&lt;param value="http://youtube.com/v/3oQUK6Ke38I" name="movie"&gt;&lt;embed type="application/x-shockwave-flash" src="http://youtube.com/v/3oQUK6Ke38I" height="350" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;object height="350" width="425"&gt;&lt;param value="http://youtube.com/v/oxfk9OkJuUE" name="movie"&gt;&lt;embed type="application/x-shockwave-flash" src="http://youtube.com/v/oxfk9OkJuUE" height="350" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5805400139429040952?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5805400139429040952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5805400139429040952' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5805400139429040952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5805400139429040952'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/12/alpha-blending-on-smartphone.html' title='Alpha Blending on SmartPhone'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-7846904966451565823</id><published>2006-12-13T19:00:00.000-08:00</published><updated>2006-12-16T16:33:27.321-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HttpWebRequest'/><category scheme='http://www.blogger.com/atom/ns#' term='ActiveSync'/><title type='text'>2125 ActiveSync Internet Pass Through</title><content type='html'>I was trying to use ActiveSync as a pass through to my laptop's internet connection so that I could debug a HttpWebRequest problem while tethered to VS2005. However, I couldn't even get PIE (Pocket IE) to use the ActiveSync connection much less my app--well, now I'm at least half way there. I can browse the web using PocketIE and ActiveSync as my internet connection.&lt;br /&gt;&lt;br /&gt;1) Open ActiveSync on your computer, select File-&gt;Connection Settings. In the ComboBox below "This computer is connected to:" make sure "The Internet" is selected.&lt;br /&gt;&lt;br /&gt;2) In PIE, select Tools-&gt;Options-&gt;Connections. Then, select "The Internet" as your network.&lt;br /&gt;&lt;br /&gt;Now, I'm going to see if my own app can do this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-7846904966451565823?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/7846904966451565823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=7846904966451565823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7846904966451565823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7846904966451565823'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/12/2125-activesync-internet-pass-through.html' title='2125 ActiveSync Internet Pass Through'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-7711059453855108064</id><published>2006-12-12T18:31:00.000-08:00</published><updated>2006-12-20T22:56:39.350-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS2005'/><title type='text'>Link to Files in VS2005</title><content type='html'>David Kline &lt;a href="http://blogs.msdn.com/davidklinems/archive/2006/11/29/quick-tip-sharing-code-between-multiple-projects-in-visual-studio-2005.aspx"&gt;posted about sharing code&lt;/a&gt; between multiple projects (where a common assembly is not appropriate):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;I would prefer to not create a duplicate of this file as maintaining changes between the two copies can be time consuming and error prone.  Fortunately, Visual Studio 2005 has a great feature to allow for file sharing between projects -- you can add an existing file as a link.  Here's how:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;1. In the project where you wish to add the file, right click the project name in the Solution Explorer&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;2. Select Add and then Existing Item...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;3. In the Add Existing Item dialog, navigate to the desired file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;4. Click the downward pointing arrow next to the Add button and select Add As Link.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   Once added to a project, linked files are easy to identify by the small arrow in the lower-left corner of the file icon in the Solution Explorer.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-7711059453855108064?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/7711059453855108064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=7711059453855108064' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7711059453855108064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7711059453855108064'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/12/link-to-files-in-vs2005.html' title='Link to Files in VS2005'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-646450307293192348</id><published>2006-11-19T15:16:00.000-08:00</published><updated>2006-12-21T15:21:16.482-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Performance Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Measuring CPU Load</title><content type='html'>I am looking for an API call or library I can download that provides access to CPU load information. I am willing to pay for third-party commercial applications. I have scoured the internet and it doesn't appear like anything exists out there. I experimented with the &lt;a href="http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx"&gt;.NET CF Remote Performance Monitor&lt;/a&gt; today but that does not include any CPU statistics.&lt;br /&gt;&lt;br /&gt;Note, it appears that the pps tool from http://www.xs4all.nl/~itsme/projects/xda/tools.html might do the trick. Further investigation is needed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-646450307293192348?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/646450307293192348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=646450307293192348' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/646450307293192348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/646450307293192348'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/11/measuring-cpu-load.html' title='Measuring CPU Load'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-5822014192223674758</id><published>2006-11-13T13:48:00.000-08:00</published><updated>2006-11-15T17:12:54.924-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Native'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Cannot Create Native C++ Projects</title><content type='html'>&lt;span style="font-style: italic;font-size:85%;" &gt;If you try to create a native C++ Smart Device project, you would have repeatedly try to finish the ‘New Project’ dialog but wouldn’t have been able to get it to work.&lt;br /&gt;&lt;br /&gt;This problem is due to the New Project dialog not playing nice with the changes in Internet Explorer 7 (the New Project dialog for native projects is actually a glorified web browser control).&lt;br /&gt;&lt;br /&gt;The workaround is simple - Open the registry entry:&lt;br /&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Ext\PreApproved&lt;br /&gt;Add a new entry and name it&lt;br /&gt;{D245F352-3F45-4516-B1E6-04608DA126CC}&lt;br /&gt;&lt;br /&gt;Again this is something we have fixed for Visual Studio 2005 SP1. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(&lt;a href="http://blogs.msdn.com/vsdteam/archive/2006/06/30/652554.aspx"&gt;link&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Update 11/13/2006 2:50PM:&lt;/span&gt; Note: this did not work for me. I am currently installing the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=8d702463-674b-4978-9e22-c989130f6553&amp;displaylang=en"&gt;Visual Studio 2005 SP1 Beta&lt;/a&gt; release; hopefully this fixes the problem as well.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Update 11/13/2006 6:50PM:&lt;/span&gt; VS2005 SP1 Beta works!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5822014192223674758?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5822014192223674758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5822014192223674758' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5822014192223674758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5822014192223674758'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/11/cannot-create-native-c-projects.html' title='Cannot Create Native C++ Projects'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-4312087484601166058</id><published>2006-11-07T13:01:00.000-08:00</published><updated>2006-11-13T14:46:41.155-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server Everywhere Renamed</title><content type='html'>SQL Server Everywhere has been renamed to SQL Server Compact Edition. I guess there was a lot of confusion about what SQL Server Everywhere was--particularly, disambiguating it with SQL Server Express.&lt;br /&gt;&lt;br /&gt;(&lt;a href="http://blogs.msdn.com/stevelasker/archive/2006/10/31/sql-server-everywhere-gets-yet-another-name.aspx"&gt;link&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-4312087484601166058?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/4312087484601166058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=4312087484601166058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4312087484601166058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4312087484601166058'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/11/sql-server-everywhere-renamed.html' title='SQL Server Everywhere Renamed'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-8616434211989307632</id><published>2006-09-28T16:34:00.000-07:00</published><updated>2006-11-05T16:09:20.971-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Platforms'/><title type='text'>Platforms for .NET CF 2.0</title><content type='html'>As a corrollary to my last post, what does .NET CF 2.0 run on? According to Jim Wilson's &lt;a href="http://pluralsight.com/blogs/jimw/archive/2005/11/14/16776.aspx"&gt;post&lt;/a&gt;:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;PocketPC 2003 &amp;amp; PocketPC 2003 SE&lt;/li&gt;&lt;li&gt;PocketPC 2005 (or 5.0)&lt;/li&gt;&lt;li&gt;SmartPhone 2005 (or 5.0)&lt;/li&gt;&lt;li&gt;WindowsCE 5.0&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-8616434211989307632?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/8616434211989307632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=8616434211989307632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8616434211989307632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/8616434211989307632'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/09/platforms-for-net-cf-20.html' title='Platforms for .NET CF 2.0'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-376149961264801931</id><published>2006-09-28T16:17:00.000-07:00</published><updated>2006-11-05T16:08:48.009-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows CE'/><title type='text'>WindowsCE vs. Windows Mobile</title><content type='html'>&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;What is the difference between Windows CE and Windows Mobile-based Smartphone and Pocket PC software?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Windows CE is a customizable, embedded operating system for a variety of small-footprint devices. OEMs can use Windows CE to design platforms and customize applications to maximize the user experience for devices such as handhelds, thin clients, logic controllers, and advanced consumer electronics.&lt;br /&gt;&lt;br /&gt;Windows Mobile is a complete software platform built on Windows CE. Unlike Windows CE, the Windows Mobile Smartphone and Pocket PC operating systems are specifically designed for devices that require a specialized hardware configuration. The software includes standardized interfaces and applications that ensure compatibility across hardware designs. For more information, visit the Windows Mobile Web site.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;(&lt;a href="http://www.microsoft.com/windows/embedded/plan_faq.mspx#q6"&gt;link&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Mike Hall adds his two cents &lt;a href="http://blogs.msdn.com/mikehall/archive/2005/03/15/395958.aspx"&gt;here&lt;/a&gt; with regards to the above as well as Windows XP Embedded.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-376149961264801931?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/376149961264801931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=376149961264801931' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/376149961264801931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/376149961264801931'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/09/windowsce-vs-windows-mobile.html' title='WindowsCE vs. Windows Mobile'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-4085761784951919129</id><published>2006-09-14T11:42:00.000-07:00</published><updated>2006-09-14T11:51:27.256-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><category scheme='http://www.blogger.com/atom/ns#' term='CAB'/><title type='text'>Installing a Windows Mobile Application from Desktop</title><content type='html'>Jim Wilson talks about how to create a Windows Mobile device application installer that works from from the Windows Desktop. (&lt;a href="http://pluralsight.com/blogs/jimw/archive/2006/09/11/37653.aspx"&gt;link&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-4085761784951919129?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/4085761784951919129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=4085761784951919129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4085761784951919129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4085761784951919129'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/09/installing-windows-mobile-application.html' title='Installing a Windows Mobile Application from Desktop'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-9024312546669257831</id><published>2006-08-29T09:34:00.000-07:00</published><updated>2006-08-29T09:41:38.880-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ListChanged'/><category scheme='http://www.blogger.com/atom/ns#' term='Bug'/><category scheme='http://www.blogger.com/atom/ns#' term='SystemState'/><category scheme='http://www.blogger.com/atom/ns#' term='Appointment'/><title type='text'>Appointment ListChanged Event</title><content type='html'>It appears as though the ListChanged event in PocketOutlook for the AppointmentCollection does not work correctly--at least I couldn't get it to work. Not too much on the web about this but I found a related post on the &lt;a target="_top" href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework" class="gl"&gt;microsoft.public.dotnet.framework.compactframework&lt;/a&gt; newsgroup:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Has anyone been able to receive an event when you've registered to receive events from ListChanged?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Here is the code I'm using (I'm using VS 2005 RC1 with CF 1.0):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;OutlookSession outlook = new OutlookSession();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;outlook.Appointments.Items.ListChanged += new&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;ListChangedEventHandler(Items_ListChanged);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;This code runs just fine, but changing the calendar doesn't fire this event in my application. I've searched the net, but haven't found anyone who appears to have used it. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Peter Foot, from &lt;a href="http://www.inthehand.com/"&gt;InTheHand&lt;/a&gt; fame, then responded:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;I haven't checked, but it's possible that the events in Microsoft.WindowsMobile.PocketOutlook only fire when the changes are made through these APIs not when changed from another application... &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The original poster, however, corrected Peter with information from the MSDN docs:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Here's what the docs say:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;"Occurs when either the collection changes, or when an individual PIM item in the collection changes."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Additionally, the MSDN article "What's New for Developers in Windows Mobile 5.0" says that you can track changes made to Pocket Outlook folders using managed code and gives an example, so it sounds like it should show changes made by other applications. As far as I can tell, that's the whole idea, in fact.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;But I can't get it to trigger any events. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-9024312546669257831?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/9024312546669257831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=9024312546669257831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/9024312546669257831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/9024312546669257831'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/appointment-listchanged-event.html' title='Appointment ListChanged Event'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-1295464344222494322</id><published>2006-08-29T00:48:00.000-07:00</published><updated>2007-10-09T17:48:32.891-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Calendar'/><category scheme='http://www.blogger.com/atom/ns#' term='Bug'/><category scheme='http://www.blogger.com/atom/ns#' term='SystemState'/><category scheme='http://www.blogger.com/atom/ns#' term='Appointment'/><title type='text'>SystemState CalendarAppointment Events Seem Very Broken</title><content type='html'>I posted the following to &lt;a target="_top" href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework" class="gl"&gt;microsoft.public.dotnet.framework.compactframework&lt;/a&gt; about the CalendarAppointment related system states (&lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/tree/browse_frm/thread/651a3ef9e69e8e75/7f3d7870f4bd5759?rnum=1&amp;amp;_done=%2Fgroup%2Fmicrosoft.public.dotnet.framework.compactframework%2Fbrowse_frm%2Fthread%2F651a3ef9e69e8e75%3F#doc_7f3d7870f4bd5759"&gt;direct link&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;For the most part, I've had good experiences with the new &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Microsoft.WindowsMobile.Status.SystemState infrastructure in .NET CF &lt;/span&gt;&lt;span style="font-style: italic;"&gt;2.0. However, recently I've run up against numerous issues with the &lt;/span&gt;&lt;span style="font-style: italic;"&gt;CalendarAppointment* and CalendarNextAppointment* events. Incidentally, &lt;/span&gt;&lt;span style="font-style: italic;"&gt;I've tested this on the I-Mate KJAM Pocket PC Phone as well as the &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Cingular 2125, T-Mobile SDA, and the I-Mate SP5m SmartPhones. It &lt;/span&gt;&lt;span style="font-style: italic;"&gt;shouldn't be too hard to repo what I'm describing on your own device. &lt;/span&gt;&lt;br /&gt;&lt;p style="font-style: italic;"&gt;I will describe the problems in descending importance:&lt;br /&gt;&lt;/p&gt;&lt;p style="font-style: italic;"&gt;1. The SystemState calendar related events do not properly notify subscribers when the calendar appointment state changes. My impression of these system states is that an event will be fired throughout the day as a user's calendar appointments occur. I would say that in more than 90% of the cases, no event is triggered. I haven't been able to diagnose exactly why this is. The problem I'm describing here seems relevant for all calendar related events. For example,&lt;br /&gt;&lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;private SystemState _stateCalendarAppointmentBusyStatus;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;private void Init()&lt;br /&gt;{&lt;br /&gt;_stateCalendarAppointmentBusyStatus = new&lt;br /&gt;SystemState(SystemProperty.CalendarAppointmentBusyStatus, true);&lt;br /&gt;_stateCalendarAppointmentBusyStatus.Changed += new&lt;br /&gt;ChangeEventHandler(OnStateCalendarAppointmentBusyStatusChanged);&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;div id="qhide_146284" style="display: block; font-style: italic;" class="qt"&gt;&lt;span style="font-size:85%;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;private void OnStateCalendarAppointmentBusyStatusChanged(object sender, &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; ChangeEventArgs args) &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; { &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    AppendText(SystemProperty.CalendarAppointmentBusyStatus, &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; (BusyStatus)args.NewValue); &lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;div id="qhide_146285" style="display: block; font-style: italic;" class="qt"&gt;&lt;span style="font-size:85%;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;private void AppendText(SystemProperty systemProperty, object newValue) &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; { &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    _textBox.Text += systemProperty + ": " + newValue + "\r\n"; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;div id="qhide_146286" style="display: block; font-style: italic;" class="qt"&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-style: italic;"&gt;Just to add a little more feedback on this (at the risk of muddling my &lt;/span&gt;&lt;span style="font-style: italic;"&gt;point). I do actually tend to see events fire if I go in and modify the &lt;/span&gt;&lt;span style="font-style: italic;"&gt;_current_ calendar entry. For example, if it's 4:15PM and I change my &lt;/span&gt;&lt;span style="font-style: italic;"&gt;current calendar appointment (which occurs from 4-5:00PM) from "Busy" &lt;/span&gt;&lt;span style="font-style: italic;"&gt;to "Out of Office", a calendar related event (e.g., CalendarAppointment &lt;/span&gt;&lt;span style="font-style: italic;"&gt;or CalendarAppointmentBusyStatus) will fire. However, if it's 3:59PM &lt;/span&gt;&lt;span style="font-style: italic;"&gt;and my current calendar entry says that I am "Free" then at 4:00PM, &lt;/span&gt;&lt;span style="font-style: italic;"&gt;when you would expect my 4 o'clock appointment event to trigger an &lt;/span&gt;&lt;span style="font-style: italic;"&gt;event, nothing happens :( &lt;/span&gt;&lt;br /&gt;&lt;p style="font-style: italic;"&gt;2. At this point, I thought perhaps I misunderstood what the current calendar appointment events did particularly because I seemed to get events when I would go into the calendar and modify the current appointment. However, this isn't the issue. I setup a polling sensor that would, instead of relying on the events, constantly poll the calendar related system states. You can do this because calling SystemState.CalendarAppointment, for example, returns the current value of that system state. However, what I found through polling was that this system state was not actually changing. To test this out, setup a "refresh" button in your GUI or run a windows Timer object to spit out the current state of the CalendarAppointment* system states. Then, add 5 or 6 test appointments to your calendar that will occur over the course of the next 10 minutes. You'll note that the states don't actually change with the calendar appointments. I've found that the CalendarAppointment* and CalendarNextAppointment* seem to be particularly troublesome while CalendarHomeScreenAppointment* stuff works a little more frequently (though these events are much less useful to us).&lt;br /&gt;&lt;/p&gt;&lt;p style="font-style: italic;"&gt;3. Going back to using the system state events. Interestingly, the following code will sometimes throw a NullReferenceException because the args object passed in is null. Perhaps this makes sense--if the current appointment is deleted the BusyStatus switches from a known state to a null state--however, this is underdocumented. An unsavvy programmer could easily fail to null check the ChangeEventArgs argument.&lt;br /&gt;&lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;private void OnStateCalendarAppointmentBusyStatusChanged(object sender,&lt;br /&gt;ChangeEventArgs args)&lt;br /&gt;{&lt;br /&gt;AppendText(SystemProperty.CalendarAppointmentBusyStatus,&lt;br /&gt;(BusyStatus)args.NewValue);&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;div id="qhide_146287" style="display: block; font-style: italic;" class="qt"&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-style: italic;"&gt;Hopefully someone at MS has the patience to read through this whole  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;post and respond. If you made it this far, thanks! &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;UPDATE 09/11/2007:&lt;/span&gt; I received word from Microsoft today that this is indeed a bug in WM 5.0. Direct quote from the Microsoft employee, "I’ve confirmed the bug on WM 5.0, but it seems to be fixed in WM 6.0.  That is, that the Notification Broker (and associated registry settings) don’t update properly when the calendar changes."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-1295464344222494322?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/1295464344222494322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=1295464344222494322' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/1295464344222494322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/1295464344222494322'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/systemstate-calendarappointment-events.html' title='SystemState CalendarAppointment Events Seem Very Broken'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-5887796443454905608</id><published>2006-08-25T23:35:00.000-07:00</published><updated>2008-02-09T03:17:16.171-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Date'/><category scheme='http://www.blogger.com/atom/ns#' term='Bug'/><category scheme='http://www.blogger.com/atom/ns#' term='SystemState'/><title type='text'>Issues with SystemState.Date</title><content type='html'>The SystemState functionality on Windows Mobile 5.0 phones provides a straightforward facility for tracking certain device states and events (e.g., power, signal strength, sms and phone calls). See this &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/wce50conStatStorBaseProperties.asp"&gt;link&lt;/a&gt; for a listing of all (144?) individual system states that one can easily track with the .NET event model. However, we've identified a few problems with this framework in   my lab.&lt;br /&gt;&lt;br /&gt;The first relates to SystemProperty.Date. Subscribing to the SystemProperty.Date results in a ChangedEventArgs object with the wrong value type, or, at least a value type that is inconsistent with documentation. Even the SystemState.Date type (which is of type System.DateTime) would leave you to believe that the ChangedEventArgs.NewValue object would be of type DateTime. In this case, however, it's actually a byte array of length 8. We believe this represents milliseconds in UTC time (8 bytes in C# is a long type). See this &lt;a href="http://msdn.microsoft.com/netframework/programming/bcl/faq/DateAndTimeFAQ.aspx"&gt;Date and Time&lt;/a&gt; article at MSDN for more on working with date and time. This typing issue results in a InvalidCastException in the following code.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;private SystemState _stateDate;&lt;br /&gt;&lt;br /&gt;cstr(){&lt;br /&gt; _stateDate = new SystemState(SystemProperty.Date);&lt;br /&gt; stateDate.Changed += new ChangeEventHandler(OnStateDateChanged);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void OnStateDateChanged(object sender, ChangeEventArgs args){&lt;br /&gt; //The code below will throw an exception as the args.NewValue type is actually&lt;br /&gt; //a byte array of size 8! This is undocumented and unexplained.&lt;br /&gt; DateTime date = ((DateTime)args.NewValue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;I have not comprehensively explored this issue. Other than the fact that the arg.NewValue is a byte array of length 8, I cannot elaborate. It is only conjecture that args.NewValue here is a timestamp in milliseconds at UTC. Regardless, it seems to contradict documentation and go against the paradigm established by other SystemState functions.&lt;br /&gt;&lt;br /&gt;One final note about this state. The SystemState.Date &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/wce50conStatStorBaseProperties.asp"&gt;docs&lt;/a&gt; say:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Gets the current date. This Date/Time value changes once per day. Monitor this property to perform actions on a daily basis. Do not use &lt;/span&gt;&lt;b style="font-style: italic;"&gt;Date&lt;/b&gt;&lt;span style="font-style: italic;"&gt; to get an accurate clock time; instead, use &lt;/span&gt;&lt;b style="font-style: italic;"&gt;Time&lt;/b&gt;&lt;span style="font-style: italic;"&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The documentation does not explicitly point out the strategy or time of day that SystemState.Date changes, only that it changes daily. I had hoped that it would change at midnight each and every day; however, what we found was that SystemState.Date appeared to change at midnight GMT (or 5PM PST). So, even if you were to schedule a daily routine with this property, it wouldn't necessarily be at the beginning of the day. Given this limitation, we decided to roll our own SystemState.Date event class that fires at midnight each day.&lt;br /&gt;&lt;br /&gt;If I get a chance this weekend, I'd like to follow up this post with the problems we've experienced at my lab with the SystemState.CalendarAppointment* properties. They don't appear to change at all no matter what the calendar/appointment structure is like on the phone.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update February 9th, 3:15AM:&lt;/span&gt; My suspicions about the 8-byte array were somewhat correct. It is a representation of DateTime. This is how you properly convert the byte array to a DateTime object:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;&lt;span style="font-family:Courier New, Courier, Monospace;color:#000000;"&gt;byte[] rawValue = SystemState.GetValue (SystemProperty.Time) as byte&lt;/span&gt;&lt;span style="font-family:Courier New, Courier, Monospace;color:#000000;"&gt;[];&lt;br /&gt;long&lt;/span&gt;&lt;span style="font-family:Courier New, Courier, Monospace;color:#000000;"&gt; value = BitConverter.ToInt64 (rawValue, 0);&lt;br /&gt;DateTime time = DateTime.FromFileTime (value);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-5887796443454905608?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/5887796443454905608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=5887796443454905608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5887796443454905608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/5887796443454905608'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/issues-with-systemstatedate.html' title='Issues with SystemState.Date'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-7032823693774684338</id><published>2006-08-22T09:03:00.000-07:00</published><updated>2006-08-22T09:06:09.565-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Size Limit of SQL Server 2005 Mobile Database</title><content type='html'>Size limit of SQL Server 2005 Mobile database: 4 Gigabytes.&lt;br /&gt;Size limit of SQL Server Everywhere Edition database: 4 Gigabytes.&lt;br /&gt;&lt;br /&gt;(&lt;a href="http://blogs.msdn.com/sqlmobile/archive/2006/06/12/628508.aspx"&gt;link&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-7032823693774684338?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/7032823693774684338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=7032823693774684338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7032823693774684338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/7032823693774684338'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/size-limit-of-sql-server-2005-mobile.html' title='Size Limit of SQL Server 2005 Mobile Database'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-4580064413617436444</id><published>2006-08-21T10:58:00.000-07:00</published><updated>2006-08-21T13:47:10.458-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='SqlCeParameter'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SqlCeParameter Bug?</title><content type='html'>I made the following &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/tree/browse_frm/thread/d40178bf153d037b/9e3e6de18c4449ec?rnum=1&amp;_done=%2Fgroup%2Fmicrosoft.public.sqlserver.ce%2Fbrowse_frm%2Fthread%2Fd40178bf153d037b%3F#doc_9e3e6de18c4449ec"&gt;post&lt;/a&gt; to &lt;a target="_top" href="http://groups.google.com/group/microsoft.public.sqlserver.ce" class="gl"&gt;microsoft.public.sqlserver.ce&lt;/a&gt; on August 17th.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;The following SqlCeCommand throws an exception. Is this a bug or am I doing something wrong?&lt;br /&gt;&lt;br /&gt;SqlCeCommand sqlCmd = sqlConn.CreateCommand();&lt;br /&gt;sqlCmd.CommandText = String.Format("INSERT INTO {0} (UserId, VersionId, {1}, PropertyName, PropertyValue, PropertyValueType) VALUES (@userid, @versionid, @headercolumnval, @propertyname, @propertyvalue, @propertyvaluetype)", strTable, headerName);&lt;br /&gt;String strValue = p.Value.ToString();&lt;br /&gt;sqlCmd.Parameters.Add("@userid", SqlDbType.NVarChar, 255, "UserId").Value = Globals.UserId;&lt;br /&gt;sqlCmd.Parameters.Add("@versionid", SqlDbType.BigInt, 8, "VersionId").Value = Globals.VersionId;&lt;br /&gt;sqlCmd.Parameters.Add("@headercolumnval", SqlDbType.NVarChar, 255, headerName).Value = headerColumnValue;&lt;br /&gt;sqlCmd.Parameters.Add("@propertyname", SqlDbType.NVarChar, 255, "PropertyName").Value = p.Key;&lt;br /&gt;sqlCmd.Parameters.Add("@propertyvalue", SqlDbType.NVarChar, 4000, "PropertyValue").Value = strValue;&lt;br /&gt;sqlCmd.Parameters.Add("@propertyvaluetype", SqlDbType.NVarChar, 255, "PropertyValueType").Value = p.Type.FullName;&lt;br /&gt;sqlCmd.Transaction = sqlTransact;&lt;br /&gt;sqlCmd.Prepare();&lt;br /&gt;sqlCmd.ExecuteNonQuery();&lt;br /&gt;sqlCmd.Dispose();&lt;br /&gt;&lt;br /&gt;Throws the following exception at the sqlCmd.ExecuteNonQuery() line:&lt;br /&gt;&lt;br /&gt;System.InvalidOperationException was unhandled&lt;br /&gt;Message="@propertyvalue : String truncation: max=255, len=463, value="(removed for posting clarity)"."&lt;br /&gt;StackTrace:&lt;br /&gt;at System.Data.SqlServerCe.SqlCeCommand.FillParameterDataBindings()&lt;br /&gt;at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText()&lt;br /&gt;at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand()&lt;br /&gt;at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()&lt;br /&gt;at MyExperience.IO.DatabasePopulator.InsertProperty()&lt;br /&gt;at MyExperience.IO.DatabasePopulator.ParseTriggers()&lt;br /&gt;at MyExperience.IO.DatabasePopulator.Populate()&lt;br /&gt;at MyExperience.MyExperienceFramework.Initialize()&lt;br /&gt;at MyExperience.Application.MainForm.OnLoad()&lt;br /&gt;at System.Windows.Forms.Form._SetVisibleNotify()&lt;br /&gt;at System.Windows.Forms.Control.set_Visible()&lt;br /&gt;at OpenNETCF.Windows.Forms.Application2.RunMessageLoop()&lt;br /&gt;at OpenNETCF.Windows.Forms.Application2.Run()&lt;br /&gt;at MyExperience.Application.Program.Main()&lt;br /&gt;&lt;br /&gt;However, if I change the line:&lt;br /&gt;&lt;br /&gt;sqlCmd.Parameters.Add("@propertyvalue", SqlDbType.NVarChar, 4000, "PropertyValue").Value = strValue;&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;sqlCmd.Parameters.Add("@propertyvalue", SqlDbType.NVarChar).Value = strValue;&lt;br /&gt;&lt;br /&gt;no exception is thrown and, better yet, the full amount of data actually makes it into the database. That is, the value is not truncated to the 255 length that Sql somehow thinks exists as a constraint.&lt;br /&gt;&lt;br /&gt;Note that my schema for this table looks like:&lt;br /&gt;&lt;br /&gt;TableName:&lt;br /&gt;TriggerProperties&lt;br /&gt;&lt;br /&gt;Columns:&lt;br /&gt;UserId (PK, nvarchar(255), not null)&lt;br /&gt;VersionId (PK, nvarchar(255), not null)&lt;br /&gt;TriggerName (PK, nvarchar(255), not null)&lt;br /&gt;PropertyName (PK, nvarchar(255), not null)&lt;br /&gt;PropertyValue (nvarchar(4000), not null)&lt;br /&gt;PropertyValueType (nvarchar(255), not null)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;I followed this post up with this &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/tree/browse_frm/thread/d40178bf153d037b/9e3e6de18c4449ec?rnum=1&amp;_done=%2Fgroup%2Fmicrosoft.public.sqlserver.ce%2Fbrowse_frm%2Fthread%2Fd40178bf153d037b%3F#doc_3f4acb5227ef298f"&gt;one&lt;/a&gt; on August 18th:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Ah, it looks like SqlCeParameter forces the Size property to 255. That's strange given the fact that the docs say, as previously mentioned, that the nvarchar data type can range from 1 to 4000 characters.&lt;br /&gt;&lt;/span&gt; &lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;However, bear in mind, that by simply avoiding setting the Size property (either via the constructor or the property itself) allows one to INSERT nvarchar data much larger than 255. In other words, it looks like this "bug" is at the parameter level and not database level.&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;This is the test code:&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;for (int i = 0; i &lt;= 500; i+=100){   SqlCeParameter param = new SqlCeParameter("@Test",  SqlDbType.NVarChar, i);   Debug.WriteLine(i + ": " + param.Size); &lt;/span&gt; &lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;  //Just in case the property acts differently, set it and print again&lt;br /&gt;param.Size = i;&lt;br /&gt;Debug.WriteLine(i + ": " + param.Size);&lt;/span&gt;&lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div id="qhide_347394" style="display: block; font-style: italic;" class="qt"&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;prints:&lt;br /&gt;&lt;/span&gt; &lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;0: 0&lt;br /&gt;0: 0&lt;br /&gt;100: 100&lt;br /&gt;100: 100&lt;br /&gt;200: 200&lt;br /&gt;200: 200&lt;br /&gt;300: 255&lt;br /&gt;300: 255&lt;br /&gt;400: 255&lt;br /&gt;400: 255&lt;br /&gt;500: 255&lt;br /&gt;500: 255&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;Any input from MS (or MVPs) on this? I'm far from being a seasoned C# SQL developer so maybe I'm doing something wrong.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Unfortunately I haven't heard any substantive comments back on usenet from MS or otherwise. Anyone in the blogosphere have an idea?&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Update 8/25/2006 @ 11:08PM: &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;On August 21st, I e-mailed the SQL Server Everywhere team via their contact page about this issue. Here's what I said:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Not sure how appropriate it is to contact you about problems I'm experiencing with Sql Mobile 2005, but I thought I'd give this a shot. If this is the wrong venue of communication, just ignore this plead for help.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;I'm having issues with the SqlCeParameter class, particularly with regards to how it handles setting the Size property. I can't seem to set the size to anything larger than 255 for the nvarchar datatype.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Please see my usenet post for more details (unfortunately no one with any expertise in this area has responded yet): &lt;/span&gt;&lt;a style="font-style: italic;" href="http://groups.google.com/group/microsoft.public.sqlserver.ce/tree/browse_frm/thread/d40178bf153d037b/9e3e6de18c4449ec?rnum=1&amp;_done=%2Fgroup%2Fmicrosoft.public.sqlserver.ce%2Fbrowse_frm%2Fthread%2Fd40178bf153d037b%3F#doc_9e3e6de18c4449ec"&gt;direct link here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I received a response on August 24th:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:85%;" &gt;&lt;span style="font-style: italic;"&gt;Yes Jon you are right that there seems to be some problem with larger than 255 chars.  I just tried and could repro it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;I shall come back to you on this after some more digging around to see if there is any work around.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To which I responded:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Thank you so much for the response. I was really hoping I'd hear back from someone at Microsoft to help me with this.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The work around that I've come up with is to simply leave out specifying the length parameter in the SqlCeParameter object. So, for my SQL data columns that are of type nvarchar and length &gt; 255 I do this:&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;SqlCeParameter param = new SqlCeParameter("@custid", SqlDbType.NVarChar);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Rather than explicitly including a length and column:&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;SqlCeParameter param = new SqlCeParameter("@custid", SqlDbType.NVarChar, 2000, “CustomerID”);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;You’ll note that in the former case your data can be of length &gt; 255 and, critically, it will still make it into the database. In the latter case, however, you incur an exception.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Perhaps my workaround will shed some light on the underlying problem.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On August 25th I received another response:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;I found the work around you used works perfectly and some of the internal apps also use it the same way as you mentioned.  &lt;/span&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;However, while digging I found that you can not use parameterized query when you have image/ntext columns (Large Object Datatype).&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt; Will update you more once I get some clarity.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To which I responded:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Hmm, I also use image data types in my SQL Mobile 2005 database and it appears to be working. In fact, a parameterized query, I believe, is the only way to get binary data into the database. What was the issue you ran into here?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-4580064413617436444?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/4580064413617436444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=4580064413617436444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4580064413617436444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4580064413617436444'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/sqlceparameter-bug.html' title='SqlCeParameter Bug?'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-936686074418119635</id><published>2006-08-19T11:11:00.000-07:00</published><updated>2006-08-19T11:29:49.850-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Nullable Types'/><title type='text'>Nullable Types</title><content type='html'>I have yet to work extensively with nullable types, a new addition to C# 2.0. A nullable type can represent the normal range of values for its underlying value type, plus an additional null value. This is somewhat similar to how SQL allows you to create an int datatype column that allows a null value. To declare a nullable type, you use the '?' operator. For example, int? num = null;&lt;br /&gt;&lt;br /&gt;More on the C# 2.0 Nullable Types&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Jon Skeet's Blog : &lt;a href="http://msmvps.com/blogs/jon.skeet/archive/2006/07/28/106119.aspx"&gt;Elegant comparisons with the null coalescing operator&lt;/a&gt;&lt;br /&gt;Jon Skeet's Blog : &lt;a href="http://www.yoda.arachsys.com/csharp/csharp2/nullable.html#coalescing"&gt;Nullable types and the null coalescing operator&lt;/a&gt;&lt;br /&gt;MSDN Reference : &lt;a href="http://msdn2.microsoft.com/en-us/library/ms173224.aspx"&gt;?? Operator (C# Reference)&lt;/a&gt;&lt;br /&gt;MSDN Reference : &lt;a href="http://msdn2.microsoft.com/en-us/library/1t3y8s4s.aspx"&gt;Nullable Types (C# Programming Guide)&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-936686074418119635?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/936686074418119635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=936686074418119635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/936686074418119635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/936686074418119635'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/nullable-types.html' title='Nullable Types'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-4633196429202145448</id><published>2006-08-18T16:22:00.000-07:00</published><updated>2006-12-21T12:28:23.368-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Downloads'/><title type='text'>Recently Published Mobile Device Downloads</title><content type='html'>Direct &lt;a href="http://www.microsoft.com/downloads/Results.aspx?sortCriteria=date&amp;FamilyID=&amp;amp;OSID=&amp;productID=&amp;amp;CategoryID=8&amp;freetext=&amp;amp;DisplayLang=en&amp;DisplayEnglishAlso="&gt;link&lt;/a&gt; to the Microsoft Download Center for Mobile Devices (sorted by release date).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-4633196429202145448?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/4633196429202145448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=4633196429202145448' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4633196429202145448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/4633196429202145448'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/recently-published-mobile-device.html' title='Recently Published Mobile Device Downloads'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-803512357647845365</id><published>2006-08-18T10:24:00.000-07:00</published><updated>2007-08-26T20:55:40.928-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reset'/><category scheme='http://www.blogger.com/atom/ns#' term='HTC'/><title type='text'>Hard Reset T-Mobile SDA</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://blog.ryjones.org/content/binary/sda.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://blog.ryjones.org/content/binary/sda.JPG" alt="" border="0" /&gt;&lt;/a&gt;Had tip: (&lt;a href="http://nino.net/blogs/nino/archive/2005/12/27/HowToHardResetYourHTCWizard.aspx"&gt;nino&lt;/a&gt; and &lt;a href="http://blog.ryjones.org/2006/04/12/Hard+Reset+HTC+Wizard.aspx"&gt;here&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Update 08/26/2007: &lt;/span&gt;I couldn't get this to work on my Cingular 2125 device. I finally figured out what I was doing wrong; I held down the power button too long. You do not need to hold the power button down until you see the boot screen... simply press it for 0.5-1 seconds. Also, &lt;a href="http://blogs.msdn.com/mpoulson/archive/2006/05/19/602031.aspx"&gt;Mike Poulson points out&lt;/a&gt; there are two ways to reset the HTC Torando/Faraday-based SmartPhone.&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif';"&gt;The first way requires you to be able to boot the phone and get to the start menu.  The second is if you cannot do this (i.e., forgot PIN or will not boot all the way).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif';"&gt;First way:&lt;o:p&gt;&lt;/o:p&gt; Start -&gt; Accessories -&gt; Clear Storage&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif';"&gt;Second way:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif';"&gt;1. Remove Battery &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif';"&gt;2. Replace battery &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif';"&gt;3. Hold down right and left soft keys &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif';"&gt;4. Press Power button for ~1.45 seconds then release Power button only &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman','serif';"&gt;5. Confirm prompt to reset&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-803512357647845365?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/803512357647845365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=803512357647845365' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/803512357647845365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/803512357647845365'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/hard-reset-t-mobile-sda.html' title='Hard Reset T-Mobile SDA'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115562326697112254</id><published>2006-08-14T23:12:00.000-07:00</published><updated>2006-12-21T12:36:01.232-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='SqlCeCommand'/><title type='text'>Usage of SqlCeCommand.Parameters</title><content type='html'>I posted the following to &lt;a target="_top" href="http://groups.google.com/group/microsoft.public.sqlserver.ce" class="gl"&gt;microsoft.public.sqlserver.ce&lt;/a&gt;:&lt;br /&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;I'm curious about the Parameters property in SqlCeCommand. Is this the preferred/best usage of  the SqlCeCommand object? I suppose one benefit of using Parameters is the ability to set binary/image data (as those are byte arrays) for insertions/updates. Are there other benefits? I tend to format all of my command statements like the following:&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;SqlCeCommand cmd = sqlConn.CreateCommand();&lt;br /&gt;cmd.CommandText = String.Format("INSERT INTO {0} (ActionName,&lt;br /&gt;ActionType) VALUES ('{1}', '{2}')", "Actions", actionName, actionType);&lt;br /&gt;cmd.Transaction = sqlTransact;&lt;br /&gt;cmd.ExecuteNonQuery();&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;instead of&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;SqlCeCommand cmd = sqlConn.CreateCommand();&lt;br /&gt;cmd.CommandText = "INSERT INTO @tablename (ActionName, ActionType)&lt;br /&gt;VALUES (@actionname, @actiontype)";&lt;br /&gt;cmd.Parameters["@tablename"].Value = "Actions";&lt;br /&gt;cmd.Parameters["@actionname"].Value = actionName;&lt;br /&gt;cmd.Parameters["@actiontype"].Value = actionType;&lt;br /&gt;cmd.Transaction = sqlTransact;&lt;br /&gt;cmd.ExecuteNonQuery();&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;What's the "best practice?"&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Ilya Tumanov, a member of the &lt;a href="http://blogs.msdn.com/netcfteam/archive/category/11167.aspx"&gt;.NET Compact Framework Team&lt;/a&gt;, responded with:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Yes, parameterized query is a preferred way. Benefits are:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  No need to create bunch of string objects all the time (in your code).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  No need to convert parameters from binaries to strings (in your code).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  No need to parse strings to get binaries back (in SQL CE).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  No locale/format specific issues as binary is format less and locale independent.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  No need to redo each command from scratch, prepared execution plan can be used with just different parameters.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;  Works for all data types including binary/image.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Performance benefits from using parameters range from significant to really huge.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(&lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/tree/browse_frm/thread/475f8f3bc7bba799/824be4033d5e0164?rnum=1&amp;_done=%2Fgroup%2Fmicrosoft.public.sqlserver.ce%2Fbrowse_frm%2Fthread%2F475f8f3bc7bba799%2F53d2d15cf36a0de4%3Flnk%3Darm%26#doc_824be4033d5e0164"&gt;link&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Update 08/16/2006 12:57AM: &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;I followed up the above post with:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Thanks so much for this thorough response--it clarified much for me.  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;One follow-up question, what do you mean by "No need to redo each &lt;/span&gt;&lt;span style="font-style: italic;"&gt;command from scratch, prepared execution plan can be used with just  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;different parameters?" This is most certainly my naivete here with &lt;/span&gt;&lt;span style="font-style: italic;"&gt;respect to SQL; a short elaboration would probably suffice.&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Illya once again responded:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a style="font-style: italic;" target="_blank" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_commands.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlc...&lt;/a&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;Preparing Commands&lt;br /&gt;To be able to execute a query, the database engine must first parse,  compile, and optimize the SQL statement. Often, this work can be done once if the command is to be executed multiple times, potentially saving time. If clients expect to run a query more than once, it is recommended that the command be prepared once, then call Execute multiple times. This should maximize performance by avoiding query recompilation. Commands can be prepared prior to execution by calling ICommandPrepare::Prepare. This is equivalent to compiling the command.&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Real life equivalent would be a move to another apartment. Would you rather move your stuff item by item or pack it and move it all at once? &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115562326697112254?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115562326697112254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115562326697112254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115562326697112254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115562326697112254'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/usage-of-sqlcecommandparameters.html' title='Usage of SqlCeCommand.Parameters'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115535024585220284</id><published>2006-08-11T19:33:00.000-07:00</published><updated>2006-12-21T12:36:37.068-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips/Tricks'/><title type='text'>Reduce Size of .NET Executables</title><content type='html'>&lt;span style="font-size:100%;"&gt;Found an article in the &lt;span style="font-style: italic;"&gt;Journal of Object Technology &lt;/span&gt;entitled "Using Reflection to Reduce the Size of .NET Executables" by Vasian Cepa (&lt;a href="http://www.jot.fm/issues/issue_2005_09/article1.pdf"&gt;link&lt;/a&gt;). One relevant section pertains to how .NET CF devices use compression by default for storing programs:&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The technique we used for compressing .NET applications does not work with .NET Compact Framework (CF) [17]. The .NET CF does not implement the methods of the Assembly and AppDomain classes that make this technique possible. However, the devices that run .NET CF use compression by default for storing programs and data in the non-volatile device memory ([17] reports up to 2:1 compression ratio). This means that this technique may not be directly needed in .NET CF devices9.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;[17] P. Yao and D. Durant. .NET Compact Framework Programming with C#. Addison Wesley, 2004.&lt;/span&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115535024585220284?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115535024585220284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115535024585220284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115535024585220284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115535024585220284'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/08/reduce-size-of-net-executables.html' title='Reduce Size of .NET Executables'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115438067992746952</id><published>2006-07-31T14:14:00.000-07:00</published><updated>2006-12-21T12:36:52.254-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><title type='text'>SQL Mobile Size Limit</title><content type='html'>Ginny Caughey, a  Device Application Development MVP, wrote about SQL Mobile size limitations in the &lt;a target="_top" href="http://groups.google.com/group/microsoft.public.sqlserver.ce" class="gl"&gt;microsoft.public.sqlserver.ce&lt;/a&gt; newsgroup (direct link &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/tree/browse_frm/thread/cf6fc8b41495d23e/b72f8d15e4dd7f66?rnum=1&amp;_done=%2Fgroup%2Fmicrosoft.public.sqlserver.ce%2Fbrowse_frm%2Fthread%2Fcf6fc8b41495d23e%3F#doc_3790561d76d1a4d0"&gt;here&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;The limit for a SQL Mobile database is 4 gb, so unless my math is wrong, you shouldn't have any problems at all with 80,000 records of that size assuming you enough space on the device. I have a production app that handles 65,000 records and on a mobile device seeking to a unique key using the table's index is almost instantaneous. One thing I have found with big databases is that sometimes queries get very slow because the query processor apparently wants more memory for its own work than I have available. I've been able to reduce a 30-minute query to well under a second by switching from using SQL syntax to TableDirect in situations like that.&lt;br /&gt;&lt;br /&gt;One other point with large amounts of data - don't try to load all that data into a DataSet. Use SqlCeResultSet and only load the data you need at any given point in your app.&lt;/span&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115438067992746952?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115438067992746952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115438067992746952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115438067992746952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115438067992746952'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/sql-mobile-size-limit.html' title='SQL Mobile Size Limit'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115437668932550208</id><published>2006-07-31T13:09:00.000-07:00</published><updated>2006-12-21T15:20:36.460-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Bug'/><title type='text'>VS2005 Debugging Problem, Breakpoints AutoDisabling Themselves</title><content type='html'>I posted today to &lt;a target="_top" href="http://groups.google.com/group/microsoft.public.dotnet.languages.csharp" class="gl"&gt;microsoft.public.dotnet.languages.csharp&lt;/a&gt; about a VS2005 debugging problem that my colleague is experiencing (&lt;a href="http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/tree/browse_frm/thread/ecd00121d83a612e/3589c3bab69ad52a?rnum=1&amp;_done=%2Fgroup%2Fmicrosoft.public.dotnet.languages.csharp%2Fbrowse_frm%2Fthread%2Fecd00121d83a612e%2F3589c3bab69ad52a%3F#doc_3589c3bab69ad52a"&gt;direct link&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;My colleague is having problems debugging in VS2005. When he sets &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; breakpoints in his code and launches his application via Debug-&gt;Start &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; New Instance, the breakpoints autodisable themselves and the &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; "breakpoint icon" switches from being filled in to outlined with a &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; warning glyph on the bottom right hand corner. When moused-over, the &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; icon reads "The breakpoint will not currently be hit. The specified &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; module is not being loaded." I checked the loaded modules list via the &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; Debug-&gt;Windows-&gt;Modules interface and the specified module was, indeed &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; loaded, with a pointer to a valid pdb (as far as I can tell). &lt;/span&gt;&lt;br /&gt; &lt;/span&gt;  &lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;I even started a brand new Form application from scratch and ran it in&lt;br /&gt; debug mode without adding any new code. I set a breakpoint at the first&lt;br /&gt; line in Program.cs but this too was autodisabled with the same "module&lt;br /&gt; is not being loaded" warning.&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;I Googled around the newsgroups/web for a while but did not find&lt;br /&gt; anything that directly related.&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;I should note also that: setting a breakpoint via &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; System.Diagnostics.Debugger.Breakpoint() works as does Debug-&gt;Step Into &lt;/span&gt;&lt;br /&gt; &lt;span style="font-style: italic;"&gt; new instance.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115437668932550208?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115437668932550208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115437668932550208' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115437668932550208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115437668932550208'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/vs2005-debugging-problem-breakpoints.html' title='VS2005 Debugging Problem, Breakpoints AutoDisabling Themselves'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115401940746319826</id><published>2006-07-27T09:52:00.000-07:00</published><updated>2006-12-21T15:21:05.453-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Benchmarking StringBuilder vs. String</title><content type='html'>A recent &lt;a href="http://www.codeproject.com/"&gt;CodeProject&lt;/a&gt; post compares StringBuilder vs. String across varying degrees of usage. &lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;In the following article I will show you the numbers for StringBuilder vs String which I did measure with .NET 2.0 a P4 3.0 GHz and 1 GB RAM. Every test was performed 5 million times to get a stable value.  &lt;/span&gt;(&lt;a href="http://www.codeproject.com/useritems/StringBuilder_vs_String.asp"&gt;link&lt;/a&gt;)&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;I wonder if the same performance would be observed on Windows Mobile Devices. &lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115401940746319826?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115401940746319826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115401940746319826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115401940746319826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115401940746319826'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/benchmarking-stringbuilder-vs-string.html' title='Benchmarking StringBuilder vs. String'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115397491685733143</id><published>2006-07-26T21:34:00.000-07:00</published><updated>2006-12-21T15:21:31.431-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Downloads'/><title type='text'>MSDN Library Free Download</title><content type='html'>According to some msdn blogs (e.g., &lt;a href="http://blogs.msdn.com/robcaron/archive/2006/07/26/678897.aspx"&gt;Rob Caron&lt;/a&gt;), MSDN June 2006 is a free download. Get it &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=373930CB-A3D7-4EA5-B421-DD6818DC7C41&amp;displaylang=en"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115397491685733143?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115397491685733143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115397491685733143' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115397491685733143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115397491685733143'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/msdn-library-free-download.html' title='MSDN Library Free Download'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115301017518745491</id><published>2006-07-15T17:32:00.000-07:00</published><updated>2006-12-21T15:22:37.572-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Limitation'/><title type='text'>TextBox OnPaint in .NET CF 2.0</title><content type='html'>&lt;span style="font-style: italic;"&gt;Is it possible to override the OnPaint and/or OnPaintBackground methods in the System.Windows.Forms.TextBox class in .NET CF 2.0?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sadly, no. See &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/tree/browse_frm/thread/e9b5fd822fc6fdc7/b278a25b508c9f37?rnum=1&amp;q=TextBox+OnPaint&amp;amp;_done=%2Fgroup%2Fmicrosoft.public.dotnet.framework.compactframework%2Fbrowse_frm%2Fthread%2Fe9b5fd822fc6fdc7%2F575ac86bf52b1ed4%3Fq%3DTextBox+OnPaint%26rnum%3D1%26#doc_b278a25b508c9f37"&gt;here&lt;/a&gt; and &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_frm/thread/545f764a629ea892/aa4d6b92ab485f48?q=TextBox+OnPaint&amp;amp;rnum=7#aa4d6b92ab485f48"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115301017518745491?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115301017518745491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115301017518745491' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115301017518745491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115301017518745491'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/textbox-onpaint-in-net-cf-20.html' title='TextBox OnPaint in .NET CF 2.0'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115299832994862894</id><published>2006-07-15T14:15:00.000-07:00</published><updated>2006-12-21T15:23:15.715-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><title type='text'>SqlServer Mobile Edition, In-Proc Database</title><content type='html'>I just posted the following to &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce?lnk=la&amp;hl=en"&gt;microsoft.public.sqlserver.ce:&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;On &lt;a href="http://www.google.com/url?sa=t&amp;ct=res&amp;amp;cd=1&amp;url=http%3A%2F%2Fblogs.msdn.com%2Fsriram%2Farchive%2F2005%2F11%2F11%2F491771.aspx&amp;amp;ei=iVq5RPzwHafOpwKYibTVBA&amp;sig2=pOLKi2A-ba0T9rzBo6Z4EQ"&gt;Sriram Krishnan's blog&lt;/a&gt; he writes, "Sql Mobile is a super-lightweight, in-proc database that runs on devices. The key phrase for me personally is 'in-proc'. This means that there is no IPC involved and as a result, performance is blindingly fast."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;This is really the only discussion I could find about in-proc databases via a quick Google search. Can anyone provide me with any more information on what an "in-proc database" is and how it differs from an "out-of-proc?" database. The implication of Sriram's post is that SqlMobile is efficient because it doesn't use interprocess communcation (assuming that's what IPC stands for). Do most databases use IPC?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;(&lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/browse_frm/thread/18ee004e565fbaef/982f26fac8e39dd6?hl=en#982f26fac8e39dd6"&gt;direct link&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;(Update: 07/16/2006 1:37PM)&lt;/span&gt; I received the following &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/tree/browse_frm/thread/18ee004e565fbaef/982f26fac8e39dd6?rnum=1&amp;_done=%2Fgroup%2Fmicrosoft.public.sqlserver.ce%2Fbrowse_frm%2Fthread%2F18ee004e565fbaef%3F#doc_f07be88085abb8a9"&gt;response &lt;/a&gt;from  Ginny Caughey, a  Device Application Development MVP.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Some databases such as SQL Server run as services in their own &lt;/span&gt;&lt;span style="font-style: italic;"&gt;process space, often on a different machine from the apps that consume those &lt;/span&gt;&lt;span style="font-style: italic;"&gt;services. Others such as SQL Server Everywhere/SQL Mobile are DLLs that run &lt;/span&gt;&lt;span style="font-style: italic;"&gt;in the same process space as the application that uses them. Not only does &lt;/span&gt;&lt;span style="font-style: italic;"&gt;this imply that there is no process boundary to impact perforamance, but &lt;/span&gt;&lt;span style="font-style: italic;"&gt;also when the hosting application ends, so does the database engine so there &lt;/span&gt;&lt;span style="font-style: italic;"&gt;is no service running to serve as a potential security threat. There are &lt;/span&gt;&lt;span style="font-style: italic;"&gt;advantages to client/server databases such as SQL Server, but for &lt;/span&gt;&lt;span style="font-style: italic;"&gt;stand-alone and mobile apps, there are also advantages for an in-process &lt;/span&gt;&lt;span style="font-style: italic;"&gt;database such as SQL Mobile/Everywhere.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;(&lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/tree/browse_frm/thread/18ee004e565fbaef/982f26fac8e39dd6?rnum=1&amp;_done=%2Fgroup%2Fmicrosoft.public.sqlserver.ce%2Fbrowse_frm%2Fthread%2F18ee004e565fbaef%3F#doc_f07be88085abb8a9"&gt;direct link&lt;/a&gt;)&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115299832994862894?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115299832994862894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115299832994862894' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115299832994862894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115299832994862894'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/sqlserver-mobile-edition-in-proc.html' title='SqlServer Mobile Edition, In-Proc Database'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115222065344584354</id><published>2006-07-06T14:12:00.000-07:00</published><updated>2006-12-21T15:24:39.969-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenNETCF'/><title type='text'>Purchased OpenNetCF SDF 2.0</title><content type='html'>I finally went ahead and purchased the &lt;a href="http://www.opennetcf.org/PermaLink.aspx?guid=d57ace50-2762-4b19-b07d-39421829d410"&gt;SDF 2.0 Extensions for Visual Studio 2005&lt;/a&gt; from &lt;a href="http://www.opennetcf.org/"&gt;OpenNetCF.org&lt;/a&gt;. It's only fifty bucks and you get the source code, which, for me, is mostly useful for educational purposes. I'm always wondering if my coding style, design, etc. are up to par. You can also use the &lt;a href="http://www.opennetcf.org/download.asp?product=SmartDeviceFramework20"&gt;free version of the SDF 2.0&lt;/a&gt;, which isn't crippled but doesn't include the source here. I used it for quite a while before deciding that I should support the OpenNetCF team.&lt;br /&gt;&lt;br /&gt;Oh and by the way, the installer for the purchased version of SDF 2.0 takes about 15 minutes on my 3Ghz HT 1.5GB RAM Pentium 4 machine to complete. I was almost going to e-mail support that their installation package was broken but then I discovered the h2reg process, which is started by the installer, was just taking forever. I believe this is because of some of the integrated VS2005 stuff they've done in SDF 2.0. Note that the free version installs rather quickly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115222065344584354?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115222065344584354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115222065344584354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115222065344584354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115222065344584354'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/purchased-opennetcf-sdf-20.html' title='Purchased OpenNetCF SDF 2.0'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115203669683970629</id><published>2006-07-04T11:07:00.000-07:00</published><updated>2006-12-21T15:25:26.496-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActiveSync'/><title type='text'>ActiveSync, A Lesson Learned</title><content type='html'>At the risk of jumping the gun here, it appears that my ActiveSync woes were not due to Microsoft's negligence or poor programming (though, I suppose, they really should have had the ActiveSync troubleshooter page much earlier, circa 4.0 or even 3.X). In fact, it was my own fault for not noticing that my IT department at work packaged BlackICE (a firewall program) with our VPN software. So, simply by installing our VPN (a rather innocuous gesture), I created a firewall that prevented TCP traffic over port 990.&lt;br /&gt;&lt;br /&gt;Now, I'm not 100% confident that this will solve all of my ActiveSync issues but it appears that, at the moment, I've figured out the connection problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115203669683970629?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115203669683970629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115203669683970629' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115203669683970629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115203669683970629'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/activesync-lesson-learned.html' title='ActiveSync, A Lesson Learned'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115187575000965888</id><published>2006-07-02T14:27:00.000-07:00</published><updated>2006-12-21T15:25:50.122-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActiveSync'/><title type='text'>ActiveSync Connection Problems Continue</title><content type='html'>I finally decided to post to the ActiveSync newsgroup about my ActiveSync issues (&lt;a href="http://groups.google.com/group/microsoft.public.pocketpc.activesync/browse_frm/thread/7234730329ff9b49"&gt;here&lt;/a&gt;). Here's a copy of the post:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;My laptop will not connect to any of my WM 5.0 devices (including the i-mate KJAM, the Cingular 2125, and the T-MOBILE SDA). Though I've experienced this problem in the past, I've been able to uinstall and reinstall ActiveSync 4.2 and restart my computer to solve the problem.&lt;br /&gt;I've been blogging about my problematic encounters with ActiveSync for a while now but have never sought the expertise of this newsgroup. I'll provide a quick summary of my ActiveSync issues here. You can visit my blog for more details: &lt;a href="http://csharponphone.blogspot.com/2006/05/activesync-41-sit-spin.html"&gt;http://csharponphone.blogspot.com/2006/05/activesync-41-sit-spin.html&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;Basically, I plug-in my WM 5.0 device, the little networking animation starts up in the taskbar (and says acquiring network address, etc.). This icon dissapears and then the ActiveSync icon in the taskbar turns green and starts to spin. This continues until a timeout is reached at which point I'm given a choice of visiting Microsoft's troubleshooter webpage (it then forwards me on to the "If ActiveSync Cannot Receive Data Through Port 990" page). I've tried following all of the previous advice posted here and on the web, but to no avail. My laptop is running Windows Firewall and McAfee VirusScan Enterprise 8.0.0.&lt;br /&gt;&lt;br /&gt;Any help from MVPs, Microsoft employees, or anyone with a clue into what might be happening would be much appreciated.&lt;br /&gt;&lt;br /&gt;NETSTAT RETURNS:&lt;br /&gt;Active Connections&lt;br /&gt;&lt;br /&gt;Proto  Local Address          Foreign Address        State&lt;br /&gt;TCP    127.0.0.1:1150         127.0.0.1:1151         ESTABLISHED&lt;br /&gt;TCP    127.0.0.1:1151         127.0.0.1:1150         ESTABLISHED&lt;br /&gt;TCP    192.168.2.76:1038      64.233.167.125:5222    ESTABLISHED&lt;br /&gt;&lt;br /&gt;IP-CONFIG RETURNS:&lt;br /&gt;Ethernet adapter Local Area Connection 16:&lt;br /&gt;&lt;br /&gt;    Connection-specific DNS Suffix  . :&lt;br /&gt;    Description . . . . . . . . . . . : Windows Mobile-based Device #14&lt;br /&gt;    Physical Address. . . . . . . . . : 80-00-60-0F-E8-00&lt;br /&gt;    Dhcp Enabled. . . . . . . . . . . : Yes&lt;br /&gt;    Autoconfiguration Enabled . . . . : No&lt;br /&gt;    IP Address. . . . . . . . . . . . : 169.254.2.2&lt;br /&gt;    Subnet Mask . . . . . . . . . . . : 255.255.255.0&lt;br /&gt;    Default Gateway . . . . . . . . . :&lt;br /&gt;    DHCP Server . . . . . . . . . . . : 169.254.2.1&lt;br /&gt;    Lease Obtained. . . . . . . . . . : Sunday, July 02, 2006 1:53:41 PM&lt;br /&gt;    Lease Expires . . . . . . . . . . : Tuesday, August 01, 2006 1:53:41 PM&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);font-size:100%;" &gt;Update: 07/04/2006 11AM: &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-size:100%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Here's my follow-up to the post above:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;I'm ashamed to admit this, but it never occurred to me to check my&lt;br /&gt;process list to see if there was any networking software running on my&lt;br /&gt;computers that I did not know about. Imagine my surprise when I saw&lt;br /&gt;blackd.exe (part of the BlackICE firewall package). As soon as I&lt;br /&gt;noticed this, I figured this might be the root of my problem. It seems&lt;br /&gt;the company that I work for includes a custom install of the BlackICE&lt;br /&gt;installation with their VPN software. I force closed the process in&lt;br /&gt;Task Manager, plugged in my WM 5.0 device and, what do you know,&lt;br /&gt;ActiveSync turns green immediately and says connected.&lt;br /&gt;&lt;br /&gt;I probably would have thought of this earlier on, but ActiveSync would&lt;br /&gt;occassionally work--it wasn't a consistent problem. This maybe more an&lt;br /&gt;issue with BlackICE however.&lt;br /&gt;Unfortunately, the install of BlackICE that I have does not include a&lt;br /&gt;frontend, so I must manually edit their configuration file to open the&lt;br /&gt;ActiveSync related ports (despite warnings in the file itself against&lt;br /&gt;it).&lt;br /&gt;&lt;br /&gt;So, in the end, it appears my frustration was misdirected at Microsoft.&lt;br /&gt;It really should have been at my IT department for not disclosing that&lt;br /&gt;BlackICE was packaged with our VPN.&lt;br /&gt;&lt;br /&gt;Hopefully now my ActiveSync problems are solved.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115187575000965888?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115187575000965888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115187575000965888' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115187575000965888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115187575000965888'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/activesync-connection-problems.html' title='ActiveSync Connection Problems Continue'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115186479372035308</id><published>2006-07-02T11:21:00.000-07:00</published><updated>2006-12-21T15:26:19.927-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActiveSync'/><title type='text'>Two Inch View</title><content type='html'>Just added an RSS feed to a new blog called "&lt;a href="http://www.twoinchview.com/"&gt;The Two Inch View&lt;/a&gt;," which is dedicated to "Windows Mobile media and entertainment." The site design is crisp and very readable and the author has a long history with WindowsCE/Mobile (a former MVP). The site is actually sponsored by Windows Mobile, which hopefully implies a strong foundation and dedication to frequent updates. It currently has some posts on the Windows Mobile Device Center, which looks like a new skin on top of ActiveSync (and, hopefully, includes some bug fixes to ActiveSync as well).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115186479372035308?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115186479372035308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115186479372035308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115186479372035308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115186479372035308'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/07/two-inch-view.html' title='Two Inch View'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115171296166860507</id><published>2006-06-30T17:12:00.000-07:00</published><updated>2006-12-21T15:26:54.775-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='In The Hand'/><category scheme='http://www.blogger.com/atom/ns#' term='Bluetooth'/><title type='text'>Microsoft Bluetooth Stack</title><content type='html'>Peter Foot, who developed &lt;a href="http://32feet.net/"&gt;32feet.net&lt;/a&gt;, has a &lt;a href="http://32feet.net/forums/40/ShowPost.aspx"&gt;list &lt;/a&gt;of Windows Mobile devices that use the Microsoft Bluetooth Stack (as opposed to, say, some 3rd party stack like the Widcomm stack whose SDK is cost prohibitive for most developers--and certainly most graduate students like myself).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115171296166860507?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115171296166860507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115171296166860507' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115171296166860507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115171296166860507'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/06/microsoft-bluetooth-stack.html' title='Microsoft Bluetooth Stack'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115107685074915814</id><published>2006-06-23T08:32:00.000-07:00</published><updated>2006-12-21T15:27:07.405-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Downloads'/><title type='text'>.NET CF 2.0 SP1 Released</title><content type='html'>"Microsoft .NET Compact Framework version 2.0 SP1 release has been completed and is in the process of being released.  This service pack was driven customer feedback including improvements in stability, adds new debugging features, extended platform support, and new developer functionality." (from&lt;a href="http://blogs.msdn.com/netcfteam/archive/2006/06/21/642013.aspx"&gt; .NET CF Team Blog&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Download it &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0c1b0a88-59e2-4eba-a70e-4cd851c5fcc4&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115107685074915814?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115107685074915814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115107685074915814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115107685074915814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115107685074915814'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/06/net-cf-20-sp1-released.html' title='.NET CF 2.0 SP1 Released'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115103143555982151</id><published>2006-06-22T19:53:00.000-07:00</published><updated>2006-12-21T15:27:19.033-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><title type='text'>Sql Server 2005 Mobile</title><content type='html'>Astonishing as it now seems to me, I had not used SQL before integrating Sql Server 2005 mobile into my current project.  That said, I occassionally run into these problems that could only happen to a SQL neophyte. For example, I've found out the hard way that naming your table columns either Trigger, Default or Option is a bad thing and confuses the hell out of SQL (and your  development team members). Trigger, Default and Option, as I'm sure most of you know, are reserved words in Sql.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115103143555982151?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115103143555982151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115103143555982151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115103143555982151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115103143555982151'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/06/sql-server-2005-mobile.html' title='Sql Server 2005 Mobile'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-115022004377293564</id><published>2006-06-13T10:28:00.000-07:00</published><updated>2006-12-21T15:27:31.160-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActiveSync'/><title type='text'>More ActiveSync Woes</title><content type='html'>I've had trouble with "cradling the emulator" in ActiveSync ever since I found out about this feature. In VS2005, open Tools-&gt;Device Emulator Manager. In the Emulator Manager, right click on a device and select "connect." Once the specified emulator has launched and loaded, you can right click on that device (again in the Emulator Manager) and select "cradle." This should cradle the emulator to ActiveSync so you can, for example, explore the emulator file system. However, this feature rarely works for me. Typically what happens is that after I select "cradle", the icon immediately changes (signifying that the device is indeed cradled) but ActiveSync does not respond. This seems independent of the &lt;a href="http://csharponphone.blogspot.com/2006/05/activesync-41-sit-spin.html"&gt;"sit and spin"&lt;/a&gt; issue though as the ActiveSync icon does not change to green, nor does it animate at all. It simply stays gray.&lt;br /&gt;&lt;br /&gt;Ah, ActiveSync, how you destroy my workday efficiency.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (07/12/2006 11:00AM): &lt;/span&gt;OK, thanks to Sriram's feedback (see Comments), I figured this out. Here are the steps (click on the images to see full size screenshots).&lt;br /&gt;&lt;br /&gt;Step 1: Open Device Emulator Manager in VS2005 (Tools-&gt;Device Emulator Manager)&lt;br /&gt;Step 2: Right click on your device of interest, start it.&lt;br /&gt;Step 3: After the device has started, right click on the device again and select 'Cradle.' See Figure 1 below.&lt;br /&gt;Step 4: The icon should change to represent that the device has been cradled. However, this does not necessarily mean that ActiveSync has actually connected to the device. See Figure 2 below.&lt;br /&gt;Step 5: If ActiveSync has not actually connected to the device, yet the cradled icon is shown, open up ActiveSync, select File-&gt;Connection Settings. This will open up a Connection Settings Dialog. From there, click the Connect button. See Figure 3 below. This should find and connect your emulator device to ActiveSync.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/8039/1030/1600/demcradle.0.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/8039/1030/400/demcradle.0.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Figure 1: Cradle the emulator&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/8039/1030/1600/demcradled.0.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 396px; height: 259px;" src="http://photos1.blogger.com/blogger/8039/1030/400/demcradled.0.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Figure 2: Emulator supposedly cradled&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/8039/1030/1600/emulator%20not%20connected.0.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/8039/1030/400/emulator%20not%20connected.0.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Figure 3: Open ActiveSync, click on File-&gt;Connection Settings. In the Connection Settings Dialog, click on the Connect... button. This should find your cradled emulator device.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-115022004377293564?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/115022004377293564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115022004377293564' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115022004377293564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/115022004377293564'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/06/more-activesync-woes.html' title='More ActiveSync Woes'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114963492061961182</id><published>2006-06-06T15:56:00.000-07:00</published><updated>2006-12-21T15:27:51.723-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bug'/><title type='text'>Installation Error, Support Info: 4</title><content type='html'>I had problems deploying and running .NET CF 2.0 applications on my i-mate K-JAM (running Windows Mobile 5.0--OS 5.1.70). I posted this &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_frm/thread/b8418d52133a44cf/1fd3a8d046f9dc64#1fd3a8d046f9dc64"&gt;message &lt;/a&gt;to Google Groups:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;I've been unable to successfully load a small test app I've written in &lt;/span&gt;&lt;span style="font-style: italic;"&gt;VS2005 and .NET CF 2.0 (C#) for the i-mate K-Jam PocketPC Phone &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Edition. &lt;/span&gt;&lt;br /&gt;&lt;p style="font-style: italic;"&gt;The error that pops up on the K-JAM when deploying and debugging from VS2005, "Installation error. Stop all applications and processes and maximize available storage space, and run installation again. Support info: 4."&lt;br /&gt;&lt;/p&gt;&lt;p style="font-style: italic;"&gt;If I attempt to run the app by clicking on it in the file explorer on the K-JAM, I get the error, "This application (TestPocket.exe) requires a newer version of the Microsoft .NET Compact Framework than the version installed on this device." When I click details, I get:&lt;br /&gt;&lt;/p&gt;&lt;p style="font-style: italic;"&gt;TestPocket.exe&lt;br /&gt;InvalidProgramException&lt;br /&gt;&lt;/p&gt;&lt;p style="font-style: italic;"&gt;I've tried this with the target device selected as both "Windows Mobile 5.0 Pocket PC Device" and "Windows Mobile 5.0 SmartPhone Device." I receive the same error in both cases.&lt;br /&gt;&lt;/p&gt;&lt;span style="font-style: italic;"&gt;Has anyone run into this before? I can successfully deploy my test app  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;to the PocketPC and SmartPhone emulators as well as to the Cingular  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;2125 SmartPhones.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Mark Prentice replied with a pointer to a &lt;a href="http://blogs.msdn.com/markprenticems/archive/2006/03/28/563143.aspx"&gt;working solution&lt;/a&gt; at his &lt;a href="http://blogs.msdn.com/markprenticems/default.aspx"&gt;blog:&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:Arial;font-size:10;"  &gt;I’m happy to report the workaround for the system failure, which will be included in SP1, has now also been slipstreamed into the current download.&lt;span style=""&gt;  &lt;/span&gt;If .NET Compact Framework v2 CAB installation on a Windows Mobile 5.0 device fails with error #4 then this fix is for you.&lt;span style=""&gt;  &lt;/span&gt;Just re-download the NETCFv2 package and re-install!&lt;span style=""&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Here's a &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=9655156b-356b-4a2c-857c-e62f50ae9a55&amp;amp;displaylang=en"&gt;link &lt;/a&gt;to the .NET CF 2.0 download.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114963492061961182?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114963492061961182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114963492061961182' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114963492061961182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114963492061961182'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/06/installation-error-support-info-4.html' title='Installation Error, Support Info: 4'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114945866277909918</id><published>2006-06-04T14:47:00.000-07:00</published><updated>2006-12-21T15:28:12.393-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Limitation'/><title type='text'>.NET CF Menu Item Size</title><content type='html'>I'm developing an application that will be used by those with impaired vision and reduced motor control. Unfortunately, .NET CF makes it quite difficult to change font sizes for menus and menu items. In fact, MenuItem classes do not expose the Font property. In many instances, I avoid this problem because I run my application full screen--however, some messageboxes are run in "normal mode" with the menubars exposed.&lt;br /&gt;&lt;br /&gt;Daniel Moth talks about a &lt;a href="http://www.danielmoth.com/Blog/2005/01/how-small.html"&gt;work around&lt;/a&gt; which involves modifying registry settings:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;Menus (&lt;/span&gt;&lt;a style="font-style: italic;" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsmainmenuclasstopic.asp"&gt;MainMenu&lt;/a&gt;&lt;span style="font-style: italic;"&gt;, &lt;/span&gt;&lt;a style="font-style: italic;" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscontextmenuclasstopic.asp"&gt;ContextMenu&lt;/a&gt;&lt;span style="font-style: italic;"&gt; and &lt;/span&gt;&lt;a style="font-style: italic;" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsmenuitemclasstopic.asp"&gt;MenuItem&lt;/a&gt;&lt;span style="font-style: italic;"&gt;) are resized according to their Font. However, they do not expose a Font property, so you are stuck with whatever the default Font is for the platform. You can change that through the registry:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;code style="font-style: italic;"&gt;HKLM\Menu\BarFnt&lt;/code&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;DWORD "Ht" for height , DWORD "Wt" for boldness: 700 or 400&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;code style="font-style: italic;"&gt;HKLM\Menu\PopFnt&lt;/code&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;same as above, but this applies to menu items rather than the menu bar&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114945866277909918?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114945866277909918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114945866277909918' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114945866277909918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114945866277909918'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/06/net-cf-menu-item-size.html' title='.NET CF Menu Item Size'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114927636274066136</id><published>2006-06-02T12:20:00.000-07:00</published><updated>2006-12-21T21:15:32.733-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Keyword'/><title type='text'>Params Keyword</title><content type='html'>&lt;p&gt;The &lt;b&gt;params&lt;/b&gt; keyword lets you specify a method parameter that takes  an argument where the number of arguments is variable.&lt;br /&gt;&lt;br /&gt;For example,&lt;br /&gt;&lt;/p&gt;        &lt;span style="font-family: courier new;font-size:85%;" &gt;static void Main()&lt;br /&gt;    {&lt;br /&gt;        TestArgsMethod("Hello", " goodbye ", " hello");&lt;br /&gt;        &lt;/span&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt;TestArgsMethod("Numbers", 1, 2, 3, 4);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt;    }&lt;br /&gt;&lt;br /&gt;    static void TestArgsMethod(String text, params Object[] args)&lt;br /&gt;    {&lt;br /&gt;        StringBuilder sb = new StringBuilder();&lt;br /&gt;        sb.Append(text);&lt;br /&gt;        foreach(Object o in args)&lt;br /&gt;        {&lt;br /&gt;          sb.Append(o.ToString());&lt;br /&gt;        }&lt;br /&gt;        Debug.WriteLine(sb.ToString());&lt;br /&gt;    }&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114927636274066136?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114927636274066136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114927636274066136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114927636274066136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114927636274066136'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/06/params-keyword.html' title='Params Keyword'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114920051561351831</id><published>2006-06-01T15:20:00.000-07:00</published><updated>2006-12-21T15:28:59.448-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>XmlReader and LineNumber</title><content type='html'>I made this &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/afdb312d43539fc3/58538a2cd57ffe03#58538a2cd57ffe03"&gt;post&lt;/a&gt; to &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.languages.csharp" class="gl"&gt;microsoft.public.dotnet.languages.csharp&lt;/a&gt; but no one has responded, so I thought I'd repost it here. If you know the answer, please either leave a comment or respond in the newsgroup.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"According to the MSDN documentation within the XmlTextReader class for &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; .NET 2.0, the recommended practice to create XmlReader instances is &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; using the XmlReaderSettings class and the XmlReader.Create() method. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; However, the problem is, the XmlReader class does not expose certain &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; properties that I need, e.g., LineNumber, LinePosition, etc. I would &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; like to follow Microsoft's recommended practices, but I'm not sure how &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; I can get XmlTextReader functionality out of XmlReader. &lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;Should I instantiate a XmlTextReader object and pass this to the&lt;br /&gt;XmlReader.Create() method and then access this underlying text reader&lt;br /&gt;to obtain the info I need? Or is there some way to get the&lt;br /&gt;XmlReader.Create() method to return a XmlTextReader object? Or should I&lt;br /&gt;ignore there suggestion and simply create an XmlTextReader object&lt;br /&gt;manually and not use the XmlReader.Create() method at all.&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Thanks!"&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Update 07/12/2006 @ 1:03PM&lt;/span&gt;: Zafar Abbas responded with a &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.xml/tree/browse_frm/thread/4a1b1672c782c2b3/12917e966d4c3dc7?rnum=1&amp;_done=%2Fgroup%2Fmicrosoft.public.dotnet.xml%2Fbrowse_frm%2Fthread%2F4a1b1672c782c2b3%2F12917e966d4c3dc7%3F#doc_0e176693f20456f0"&gt;solution&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;The reader obtained via XmlReader.Create supports the IXmlLinfInfo interface &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; from which you can access the line properties: &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;  &lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;reader = XmlReader.Create (...)&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt; IXmlLineInfo info = reader as IXmlLineInfo;&lt;br /&gt; Console.WriteLine(info.LineNumber);&lt;br /&gt; Console.WriteLine(info.LinePosition);&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;this should print your line numbers of the current node. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114920051561351831?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114920051561351831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114920051561351831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114920051561351831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114920051561351831'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/06/xmlreader-and-linenumber.html' title='XmlReader and LineNumber'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114893382546921975</id><published>2006-05-29T13:14:00.000-07:00</published><updated>2006-12-21T21:16:40.645-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Platforms'/><title type='text'>Windows CE != Windows Mobile</title><content type='html'>"Windows Mobile &lt;u&gt;is not&lt;/u&gt; Windows CE (and vice-versa), Windows Mobile &lt;u&gt;has&lt;/u&gt; Windows CE as its core – WM 2003 was based on WinCE 4.x, WM 5.0 is based on WinCE version 5 – plus a standard shell, applications and APIs." (&lt;a href="http://blogs.msdn.com/fzandona/archive/2006/05/16/599485.aspx"&gt;link&lt;/a&gt; and a follow up &lt;a href="http://blogs.msdn.com/fzandona/archive/2006/05/25/607609.aspx"&gt;here&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114893382546921975?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114893382546921975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114893382546921975' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114893382546921975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114893382546921975'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/05/windows-ce-windows-mobile.html' title='Windows CE != Windows Mobile'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114851349552553744</id><published>2006-05-24T16:20:00.000-07:00</published><updated>2006-12-21T15:30:44.270-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='Transparency'/><title type='text'>Alpha Blending</title><content type='html'>Since my &lt;a href="http://csharponphone.blogspot.com/2006/05/transparency.html"&gt;last post&lt;/a&gt; was on drawing transparency color keys in .NET CF, I thought I should explore alpha blending as well. It is possible to do alpha blending .NET CF, but not without some effort (i.e., venturing into p/invoke). Here, at the&lt;a href="http://blogs.msdn.com/chrislorton/default.aspx"&gt; .NET CF UI and More&lt;/a&gt; blog, the author writes:&lt;br /&gt;&lt;p&gt;&lt;span style=";font-family:Tahoma;font-size:85%;"  &gt;Briefly, there are two ways to do alpha blending in WM5: the &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceshellui5/html/wce50lrfAlphaBlend.asp"&gt;&lt;span style=";font-family:Tahoma;font-size:85%;"  &gt;AlphaBlend()&lt;/span&gt;&lt;/a&gt;&lt;span style=";font-family:Tahoma;font-size:85%;"  &gt; function and with the &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcemultimedia5/html/wce50lrfimagingclasses.asp"&gt;&lt;span style=";font-family:Tahoma;font-size:85%;"  &gt;Image&lt;/span&gt;&lt;/a&gt;&lt;span style=";font-family:Tahoma;font-size:85%;"  &gt; COM object in the &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcemultimedia5/html/wce50lrfImagingStructures.asp"&gt;&lt;span style=";font-family:Tahoma;font-size:85%;"  &gt;Imaging API&lt;/span&gt;&lt;/a&gt;&lt;span style=";font-family:Tahoma;font-size:85%;"  &gt;.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;He then goes on to explain how to implement these two methods. (&lt;a href="http://blogs.msdn.com/chrislorton/archive/2006/04/07/570649.aspx"&gt;direct link&lt;/a&gt;). The happy alternative is offered through OpenNetCF (who else) in their SDF 2.0 library. See Alex Feinman's post &lt;a href="http://blog.opennetcf.org/afeinman/PermaLink,guid,8fb585db-bd44-42fe-afa9-07b116c6d2ba.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114851349552553744?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114851349552553744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114851349552553744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114851349552553744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114851349552553744'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/05/alpha-blending.html' title='Alpha Blending'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114849375534646648</id><published>2006-05-24T10:55:00.000-07:00</published><updated>2006-12-21T15:29:50.545-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='Transparency'/><title type='text'>Transparency</title><content type='html'>This morning I googled around for "standard transparency colors" in hopes that I would find a color key that is typically used to represent transparency in images. In .NET CF, the only way to make part of an image transparent is through the following code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;ImageAttributes attr = new ImageAttributes();&lt;br /&gt;attr.SetColorKey(Color.White, Color.White);&lt;br /&gt;Rectangle rDest = new Rectangle(xImage, yImage, Image.Width, Image.Height);&lt;br /&gt;g.DrawImage(Image, rDest, 0, 0, Image.Width, Image.Height, GraphicsUnit.Pixel, attr);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this case, the color "white" would be made transparent in the given Image. Note that although SetColorKey allows the developer to specify a transparency color range, I believe that this range is limited to one color on .NET CF. During my search, I found that the standard chroma key is "bright pink." However, it's also convention to automatically select the chroma key based on the upper-left hand corner pixel of the image, in hopes that this is representative of the "background" pixels. Here's a post by Ed Kaim (MSFT) that really explains this well imo.&lt;br /&gt;&lt;br /&gt;"However, the issue you're raising is why Microsoft recommends the usage of ImageAttributes in order to draw transparency, and why the top left pixel is called out as a prime source. First of all, ImageAttributes is the only feasible way to draw transparency in managed code on the .NET Compact Framework. Otherwise you'd have to go pixel by pixel and only draw the nontransparent ones, which would be slow and painful. The reason the top left pixel is offered is because it's often transparent in images with transparency. Sure, it's not *always* transparent, but it's usually transparent, due to its location in the image and the fact that most pictures on buttons don't go all the way to the top left border. However, you can decide that your standard chroma key color is bright pink (as many do) and hardcode your ImageAttributes object to use that color for all images, provided you do the work in the art to make sure the same exact color is used on the transparent spots in your files, whatever format they may be."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114849375534646648?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114849375534646648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114849375534646648' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114849375534646648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114849375534646648'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/05/transparency.html' title='Transparency'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114833093405515066</id><published>2006-05-22T13:42:00.000-07:00</published><updated>2006-12-21T21:16:17.022-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Assembly'/><title type='text'>Retrieving an Assembly's PublicKeyToken</title><content type='html'>The short of it is, use the sn -T blah.dll command (see &lt;a href="http://blog.devstone.com/Aaron/archive/2006/03/16/573.aspx"&gt;link&lt;/a&gt;). Here's the step-by-step for finding the PublicKeyToken of the System.Data.SqlServerCe.dll:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;1. Open up the Visual Studio 2005 Command Prompt from the Start Menu. That should set the environment for using VS2005 commands.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;2. C:\&gt;cd "C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;3. Type "sn -T System.Data.SqlServerCe.dll"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The sn utility will return something like: Public key token is 3be235df1c8d2ad3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;Note: if you do not include a capital T (but instead a lowercase, -t), you will receive the following error: "Failed to convert key to token -- The public key for assembly '(null)' was invalid."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114833093405515066?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114833093405515066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114833093405515066' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114833093405515066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114833093405515066'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/05/retrieving-assemblys-publickeytoken.html' title='Retrieving an Assembly&apos;s PublicKeyToken'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114832170280719931</id><published>2006-05-22T11:07:00.000-07:00</published><updated>2006-12-21T21:17:14.462-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActiveSync'/><title type='text'>ActiveSync 4.1, Sit &amp; Spin</title><content type='html'>As a .NET CF developer, I'm getting quite tired of dealing with the obvious failings of ActiveSync. It is, without a doubt, one of the most frustrating programs I've been forced to deal with. I'm currently struggling with the problem where you plug-in a Windows Mobile 5.0 device to a desktop machine running ActiveSync 4.1 and ActiveSync just sits there and continuously spins the green icon while displaying "Connecting." It will literally do this for hours (if I let it). See screen below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/8039/1030/1600/connection%20spin.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;" alt="" src="http://photos1.blogger.com/blogger/8039/1030/400/connection%20spin.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I've scoured the net for a solution and have found none. This has been happening off and on since I started working on Windows Mobile 5.0 devices. Unfortunately, I have not been able to diagnose the cause. Restarting the device does not solve the problem. Restarting the desktop (which I hate doing) does not solve the problem. Sometimes, moving the USB cable from one port to another works, but not always. I can waste a full hour or so simply trying to get my activesync connection up so I can debug my program. :(&lt;br /&gt;&lt;br /&gt;Oh and the online KB has a few reported issues with regards to ActiveSync 4.1:&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/911422/en-us"&gt;http://support.microsoft.com/kb/911422/en-us&lt;/a&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/912240/en-us"&gt;http://support.microsoft.com/kb/912240/en-us&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and, perhaps most relevant,&lt;br /&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/911423/en-us"&gt;http://support.microsoft.com/kb/911423/en-us&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Sadly, however, none of these quite get at the issue I am experiencing. This last link is closest but simply blames the problem on Windows Firewall (which I've disabled to see if it has any effect, it does not).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (05/22/2006 11:42AM):&lt;/span&gt; It appears that the ActiveSync 4.2 Beta Preview is now available and it comes with a USB troubleshooter. I'm going to try it now. See these two blog posts by Jason Langridge (&lt;a href="http://blogs.msdn.com/jasonlan/archive/2006/04/28/585488.aspx"&gt;here &lt;/a&gt;and &lt;a href="http://blogs.msdn.com/jasonlan/archive/2006/04/28/585488.aspx"&gt;here&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (05/24/2006 5:27PM): &lt;/span&gt;So far ActiveSync 4.2 has worked perfectly for me--I have not run into the "sit and spin" problem (or any problem) since upgrading.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (05/26/2006 1:59PM): &lt;/span&gt;Despite upgrading to ActiveSync 4.2 on my laptop, I still have the "sit &amp; spin" problem when connecting to my Windows Mobile 5.0 devices. The horribly ironic thing is that the "USB troubleshooter" promised in ActiveSync 4.2 is actually just a webpage and not, say, a tool. This is so frustrating. I really can't imagine being the only one with this problem as its occurred on my desktop machines (both work, school and home) and laptop with a variety of WM 5.0 devices. I am not running any firewall except the Windows XP built-in firewall (and even when I disable it, ActiveSync still just sits there spinning).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (06/02/2006 9:07PM): &lt;/span&gt;I got my laptop to work again with ActiveSync. I uinstalled ActiveSync 4.2, restarted, and then reinstalled 4.2. Now things seem to be working for the moment. Incidentally, after this reinstall, I actually got the SmartPhone emulator to cradle via the Device Manager which has never worked for me properly. Note that my work desktop machine, which had a behaving install of ActiveSync 4.2 just stopped working today. However, like with my laptop, a full reinstall of 4.2 seemed to fix the problem.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (06/13/2006 10:21AM): &lt;/span&gt;Both my advisor and my mentor at work have run into the "sit &amp; spin" problem. The solution of upgrading to 4.2 beta and restarting seems to solve the problem, but only temporarily. My advisor also tried to manually unblock all the ActiveSync ports in Windows Firewall; however, this did not seem to make a difference. As I've noted in the past, I've completely disabled Windows Firewall to try and debug the "sit &amp; spin" problem and it's not made a difference, so his experiences are not surprising.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (06/13/2006 11:00AM): &lt;/span&gt;I want to reemphasize how I often solve the "sit &amp; spin" problem as strange as it might sound. I have four USB ports on the back of my computer. If I encounter the feared continuously spinning green ActiveSync icon, I unplug my USB cord from the back of the computer and move it to another port while my WM 5.0 device is still connected to the other end. ActiveSync then appears to do some initialization (e.g., my tray shows off another icon that's animated) and then immediately connects properly. This only works for those ports in the back of my computer that have not yet had ActiveSync connections. Once I move the cord to all four ports, I must uninstall ActiveSync and start the process all over.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (07/02/2006 1PM): &lt;/span&gt;I spent a large amount of my Sunday morning and early afternoon determined once and for all to get to the bottom of the ActiveSync sit &amp; spin problem. My laptop (Dell 710m) has Windows Firewall installed as well as McAfee VirusScan 8 and two USB ports. I tested both USB ports with two different USB cords and three different WM 5.0 devices (the i-Mate K-JAM, the Cingular 2125, and the T-Mobile SDA), all of which would not connect to my laptop, despite all efforts (see the sit &amp;amp; spin problem above). Once the green ActiveSync taskbar icon spins for a certain amount of time, a dialog (new to ActiveSync 4.2) asks me if I'd like to be forwarded to a troubleshooter webpage. If I select OK, I am forwarded to a page entitled "If ActiveSync Cannot Receive Data Through Port 990" (&lt;a href="http://www.microsoft.com/windowsmobile/help/activesync/troubleshooter/port990.mspx"&gt;here&lt;/a&gt;) . The first three steps are trivial and meant to ensure that you have USB connections enabled both on the desktop and device (and yes I double and triple checked, everything looks fine in this regard). The last point (point 4), states that if I have an internet firewall, make sure its enabled to accept ActiveSync connections. Well, as previously stated, I only run Microsoft's Firewall program and upon examination, they do specifically allow connections from all ActiveSync related .exes. Just to ensure the firewall wasn't my problem, I turned it off but ran into the same problem. Finally, I uninstalled ActiveSync 4.2 and reinstalled it as directed by the USB troubleshooter &lt;a href="http://www.microsoft.com/windowsmobile/help/activesync/troubleshooter/usb.mspx"&gt;here&lt;/a&gt; (step 9). Unfortunately, though this has worked for me in the past, uninstalling ActiveSync and rebooting my devices and desktop did not solve the problem. So, now I'm stuck. No ActiveSync and no solution. I did find a set of relatively helpful links though for ActiveSync troubleshooting (the fact that there is a community formed around this problem should say something to Microsoft, no?). Here are the links:&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://www.pocketpcfaq.com/faqs/activesync/tshoot-as4x-connection.htm"&gt;ActiveSync 4.X Troubleshooting Guide - Connection Flow&lt;/a&gt; - provides a very thorough look at ActiveSync issues with respect to establishing a connection (by Chris De Herrera)&lt;br /&gt;2. &lt;a href="http://www.pocketpcfaq.com/faqs/activesync/tshoot-as4x-firewall.htm"&gt;ActiveySync 4.X Troubleshooting Guide&lt;/a&gt; - Firewall, VPN, Proxy Issues (also by Chris De Herrera)&lt;br /&gt;3. Bev Howard's &lt;a href="http://bevhoward.com/ASync.htm"&gt;Solving ActiveSync Issues&lt;/a&gt;&lt;br /&gt;4. &lt;a href="http://support.microsoft.com/kb/259369/en-us"&gt;TCP ports required by ActiveSync&lt;/a&gt; (I found this the first day I experienced the sit &amp; spin problem, but since tweaking these ports in Windows Firewall never solved anything I never linked to it. I do so for thoroughness now).&lt;br /&gt;5. &lt;a href="http://www.microsoft.com/windowsmobile/help/activesync/default.mspx"&gt;ActiveSync 4.0/4.1 TroubleShooter Guide&lt;/a&gt;&lt;br /&gt;6. The &lt;a href="http://www.microsoft.com/windowsmobile/help/activesync/troubleshooter/default.mspx"&gt;ActiveSync Troubleshooter&lt;/a&gt; (which 4.2 dynamically links to when a problem is encountered)&lt;br /&gt;&lt;br /&gt;I have not seen an outpouring of complaints on the newsgroups about this problem, though this post is one of the most actively visited on my website so presumably others are encountering it as well. By a rough estimate, I figure the Microsoft ActiveSync development team owes me about 20 hours of my time (perhaps more) based on this problem alone. Others at my research lab have also spent countless hours trying to get their WM 5.0 devices to connect to ActiveSync. Now, as computer scientists we are used to tooling around and debugging programs as well as fault-prone systems. We typically can navigate around these problems. However, if ActiveSync 4.X is broken (and, imo, it is very f*ing broken) it have dramatic implications for the userbase of our WM 5.0 product. If our users can't sync their devices, then they can't (#1) install our application and (#2) use the desktop side of our application.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (07/02/2006 8PM): &lt;/span&gt;I made a post to the microsoft.public.pocketpc.activesync newsgroup about this problem (&lt;a href="http://groups.google.com/group/microsoft.public.pocketpc.activesync/browse_frm/thread/7234730329ff9b49/7a08f701281c6f79#7a08f701281c6f79"&gt;here&lt;/a&gt;). I also copied the post to my blog &lt;a href="http://www.blogger.com/comment.g?blogID=13472432&amp;postID=115187575000965888"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Update (07/04/2006 11AM): &lt;/span&gt;It appears that my ActiveSync Sit &amp;amp; Spin issue has been resolved and in bit of probably all too common misplaced blame, it was not the fault of Microsoft as I suspected. See &lt;a href="http://csharponphone.blogspot.com/2006/07/activesync-connection-problems.html"&gt;here &lt;/a&gt;and &lt;a href="http://csharponphone.blogspot.com/2006/07/activesync-lesson-learned.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114832170280719931?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114832170280719931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114832170280719931' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114832170280719931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114832170280719931'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/05/activesync-41-sit-spin.html' title='ActiveSync 4.1, Sit &amp; Spin'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114790163406343559</id><published>2006-05-17T14:31:00.000-07:00</published><updated>2006-12-21T21:17:47.151-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Micro Framework'/><title type='text'>.NET Micro Framework</title><content type='html'>See Daniel Moth's posting &lt;a href="http://www.danielmoth.com/Blog/2006/05/net-micro-framework.html"&gt;here&lt;/a&gt;. Also, the "official" webpage &lt;a href="http://www.aboutnetmf.com/entry.asp"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114790163406343559?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114790163406343559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114790163406343559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114790163406343559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114790163406343559'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/05/net-micro-framework.html' title='.NET Micro Framework'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114782387827441320</id><published>2006-05-16T16:53:00.000-07:00</published><updated>2006-12-21T21:18:06.760-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><title type='text'>Simkin# (or SimkinCS if you will)</title><content type='html'>&lt;div align="left"&gt;Out of a desire to have a scripting language for the .NET Compact Framework, I've recently ported &lt;a href="http://www.simkin.co.uk/"&gt;Simkin &lt;/a&gt;from Java to C#. Simkin is a "high-level lightweight embeddable scripting language for Java or C++ and XML" originally written by Simon Whiteside. This &lt;a href="http://www.simkin.co.uk/Demo_Java.shtml"&gt;page &lt;/a&gt;has an online demo in Java (warning, might not play nice in all browsers).&lt;br /&gt;&lt;br /&gt;Here's a screenshot of SimkinCS running in .NET in a demo app. Click on the picture for a larger view. You can download this proof-of-concept application &lt;a href="http://abstract.cs.washington.edu/%7Ejfroehli/SimkinCSDemo.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://photos1.blogger.com/blogger/8039/1030/1600/SimkinCSDemo.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center;" alt="" src="http://photos1.blogger.com/blogger/8039/1030/400/SimkinCSDemo.png" border="0" /&gt; &lt;/a&gt;&lt;p align="center"&gt;&lt;span style="font-size:85%;"&gt;(left: before execution, right: after execution)&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;strong&gt;Update (May 17th, 2006 @ 2:02PM&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;strong&gt;):&lt;/strong&gt; &lt;/span&gt;You need the .NET 2.0 runtime environment to run this application. You can download the .NET 2.0 redistributable package &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;amp;displaylang=en"&gt;here&lt;/a&gt;. This is the reason why the application fails to run and returns the error "The application failed to initialize properly (0xc0000135)" on some systems. My guess is, though, if you read this blog you likely have .NET 2.0 installed on your machine.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114782387827441320?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114782387827441320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114782387827441320' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114782387827441320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114782387827441320'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/05/simkin-or-simkincs-if-you-will.html' title='Simkin# (or SimkinCS if you will)'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114601601705462766</id><published>2006-04-25T18:45:00.000-07:00</published><updated>2006-12-21T21:18:23.347-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scripting'/><title type='text'>Buggers, Scripting Support in .NET CF 2.0</title><content type='html'>Scripting support in .NET CF 2.0 is just as absent as in .NET CF 1.0 :(&lt;br /&gt;&lt;br /&gt;Hopefully someone will get around to answering this &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_frm/thread/8c02bb23af391fef/2e24f38264102a0c?q=scripting+.NET+CF&amp;amp;rnum=2#2e24f38264102a0c"&gt;post&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114601601705462766?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114601601705462766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114601601705462766' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114601601705462766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114601601705462766'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/04/buggers-scripting-support-in-net-cf-20.html' title='Buggers, Scripting Support in .NET CF 2.0'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114591936368663133</id><published>2006-04-24T15:54:00.000-07:00</published><updated>2006-12-21T21:19:15.321-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Application Lock'/><title type='text'>Cingular 2125 Developer Locked</title><content type='html'>Solution to Windows Mobile 5.0 hardware being developer (application) locked by default can be found &lt;a href="http://blogs.conchango.com/stuartpreston/archive/2005/11/10/2376.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Genius!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114591936368663133?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114591936368663133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114591936368663133' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114591936368663133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114591936368663133'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/04/cingular-2125-developer-locked.html' title='Cingular 2125 Developer Locked'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114478527479478596</id><published>2006-04-11T12:43:00.000-07:00</published><updated>2006-12-21T21:19:40.690-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><title type='text'>Primary Key Efficiency</title><content type='html'>Not sure if this is relevant to SQL Server Mobile or SQL Server 2005, but still interesting nonetheless. The key takeaway seems to be that the primary key should be single column if possible and an int datatype (&lt;a href="http://www.javaperformancetuning.com/news/qotm040.shtml"&gt;link&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Also, from &lt;a href="http://www.sqlteam.com/item.asp?ItemID=122"&gt;link&lt;/a&gt;, "A primary key is an attribute (or combination of attributes) that uniquely identify each instance of an entity. A primary key cannot be null and the value assigned to a primary key should not change over time. A primary key also needs to be efficient. For example, a primary key that is associated with an INTEGER datatype will be more efficient than one that is associated with a CHAR datatype. Primary keys should also be non-intelligent; that is, their values should be assigned arbitrarily without any hidden meaning. Sometimes none of the attributes of an entity are sufficient to meet the criteria of an effective primary key. In this case the database designer is best served by creating an "artificial" primary key."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114478527479478596?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114478527479478596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114478527479478596' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114478527479478596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114478527479478596'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/04/primary-key-efficiency.html' title='Primary Key Efficiency'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114471305404425743</id><published>2006-04-10T16:44:00.000-07:00</published><updated>2006-12-21T21:19:55.863-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><title type='text'>Multiple Columns as Primary Key?</title><content type='html'>I was questioning whether my database design was a good one. This is my first project using SQL (or any database for that matter) and I wondered whether using multiple columns as a primary key was "good design" or, alternatively, if I should just create a dummy column in my tables and use the IDENTITY property (so that they are auto-numbered and guaranteed unique). I guess this is a hotly debated issue. I found quite a few discussions on the web about it--with people arguing adamently in both directions.&lt;br /&gt;&lt;br /&gt;Here are a few links.&lt;br /&gt;&lt;br /&gt;1. "&lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.programming/browse_thread/thread/8d21267fee96cca9/17f748ca448f1230?lnk=st&amp;q=good+design+SQL+primary+key+multiple+columns&amp;amp;rnum=3#17f748ca448f1230"&gt;Primary Key&lt;/a&gt;" (Google Groups).&lt;br /&gt;2. "&lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.programming/browse_thread/thread/c49079dc025d3aac/5a217859f6f2ab52?lnk=st&amp;q=good+design+SQL+primary+key+multiple+columns&amp;amp;rnum=1#5a217859f6f2ab52"&gt;Design: multiple columns for primary key&lt;/a&gt;" (Google Groups)&lt;br /&gt;3. "&lt;a href="http://www.sql-server-performance.com/q&amp;a5.asp"&gt;SQL Server Performance Questions &amp;amp; Answers&lt;/a&gt;" (in favor of IDENTITY columns)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114471305404425743?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114471305404425743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114471305404425743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114471305404425743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114471305404425743'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/04/multiple-columns-as-primary-key.html' title='Multiple Columns as Primary Key?'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114470902245179853</id><published>2006-04-10T15:42:00.000-07:00</published><updated>2006-12-21T21:20:13.821-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><title type='text'>Adding Foreign Keys to .SDF via VS2005</title><content type='html'>From msdn forums:&lt;br /&gt;&lt;br /&gt;"You can't add a foreign key to a SQL Mobile database from within VS2005 - you cannot do it graphically nor by using the query designer (where it would be tempting to enter an ALTER TABLE .. ADD FOREIGN KEY statement).&lt;br /&gt;In the absence of SQL Server 2005 Management Studio in your situation, you will need to run the ALTER TABLE command either from your program code or inside of Query Analyzer 3.0 on device."&lt;br /&gt;&lt;br /&gt;(&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=294857&amp;amp;SiteID=1"&gt;link&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114470902245179853?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114470902245179853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114470902245179853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114470902245179853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114470902245179853'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/04/adding-foreign-keys-to-sdf-via-vs2005.html' title='Adding Foreign Keys to .SDF via VS2005'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-114462956393471651</id><published>2006-04-09T17:34:00.000-07:00</published><updated>2007-01-11T15:42:42.563-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='Threads'/><title type='text'>SqlCeConnection Keep Connection Open?</title><content type='html'>Consensus seems to point to keeping one instance of SqlCeConnection open for the duration of executation for performance reasons.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/f27efc83a01a003f/1a881fde009fed33?lnk=st&amp;q=SqlCeConnection+keep+connection+open&amp;amp;rnum=2&amp;hl=en#1a881fde009fed33"&gt;SqlCeConnection guidelines&lt;/a&gt; (MSDN Forums)&lt;/li&gt;&lt;li&gt;&lt;a href="http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/f27efc83a01a003f/1a881fde009fed33?lnk=st&amp;amp;q=SqlCeConnection+keep+connection+open&amp;rnum=2&amp;amp;hl=en#1a881fde009fed33"&gt;Performance with SqlCeConnection&lt;/a&gt; (Usenet)&lt;/li&gt;&lt;li&gt;&lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/browse_thread/thread/f95af747f3cd3b53/d8c89bdf05593b26?lnk=st&amp;q=SqlCeConnection+keep+connection+open&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;rnum=3&amp;hl=en#d8c89bdf05593b26"&gt;Data Architecture &amp;amp; Pooling &lt;/a&gt;(Usenet) &lt;- this is for SqlServerCe 2003        &lt;/li&gt;&lt;/ol&gt;Marcus Perry in his &lt;a href="http://blogs.msdn.com/marcpe/archive/2005/06/21/431074.aspx"&gt;MSDN blog&lt;/a&gt; notes:&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt;Creating and destroying SQL Mobile database connections is an expensive task and so the SqlCeConnection is designed to be a long lived, shared instance across the lifetime of the application. For a complex app, ideally the SqlCeConnection instance would be placed in a singleton wrapper class that manages access to the database.&lt;/blockquote&gt;&lt;br /&gt;Though this information comes from a Microsoft employee, it still seems contentious. Dave Hayden, a MS MVP, said in this &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=526164&amp;SiteID=1"&gt;MSDN forum post&lt;/a&gt;:&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt;For 99% of all applications, the best practice is to open and dispose of database connections right when you need them and &lt;u&gt;not&lt;/u&gt; to leave them open for the duration of the application. Open the database connection as late as possible and close/dispose of it as soon as possible.&lt;/blockquote&gt;&lt;br /&gt;Nicholas Paldino (a .NET/C# MVP) &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/tree/browse_frm/thread/9109a387f06b36a1/ba94dd2c1933a3e1?rnum=1&amp;q=ExecuteNonQuery+Thread+Safe&amp;amp;_done=%2Fgroup%2Fmicrosoft.public.dotnet.languages.csharp%2Fbrowse_frm%2Fthread%2F9109a387f06b36a1%2F2b6a0468b1b52c3f%3Flnk%3Dst%26q%3DExecuteNonQuery+Thread+Safe%26rnum%3D9%26#doc_a4b9e8f28ce30a54"&gt;seems to agree&lt;/a&gt; with Dave:&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt;You shouldn't keep a connection open and lying around.  The  SqlConnection class uses a connection pool in the background, and keeping your connection open is actually going to degrade your performance.  You  will want to create a new connection, open it, use it, and then close it for every operation that you do (or group of operations).  You shouldn't be holding the connection open across operations.  You will also notice MUCH  better performance when you do this. The same thing holds with the command object.  Don't use the same one. Use new ones.  If you want to use a command object over and over again, you can, but use it for the same parameterized command.  Don't keep changing the command string.&lt;/blockquote&gt;&lt;br /&gt;Both Dave and Nicholas are basing their advice on SQL Server's behavior (not SQL Server Mobile). SQL Server supports connection pooling, SQL Server Mobile does not. Again, from MS Employee Marcus Perry (&lt;a href="http://blogs.msdn.com/marcpe/archive/2005/06/21/431074.aspx#435262"&gt;link&lt;/a&gt;),&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt;There is no connection pool used for local database access for SQL Mobile.&lt;/blockquote&gt;&lt;br /&gt;If only one SqlCeConnection is used, note that it is&lt;span style="font-weight: bold;"&gt; not &lt;/span&gt;thread safe. Thus, a multithread application must provide mechanisms to safely access the SQL database from multiple threads. There seem to be two approaches: one is to make the singleton wrapper class (mentioned above) thread safe and the other is to give each thread access to its own SqlCeConnection object. See these MSDN forum posts (&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=253583&amp;SiteID=1"&gt;here&lt;/a&gt; and &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=222377&amp;amp;SiteID=1"&gt;here&lt;/a&gt;). Microsoft has yet to endorse a specific approach as a "best practice" (a discussion about this can be found &lt;a href="http://groups.google.com/group/microsoft.public.sqlserver.ce/browse_frm/thread/257058eeed58f8c1/42bb87347603eaad?lnk=gst&amp;q=thread&amp;amp;rnum=4#42bb87347603eaad"&gt;here&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-114462956393471651?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/114462956393471651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=114462956393471651' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114462956393471651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/114462956393471651'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/04/sqlceconnection-keep-connection-open.html' title='SqlCeConnection Keep Connection Open?'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-113993891357164786</id><published>2006-02-14T09:40:00.000-08:00</published><updated>2006-02-14T09:41:53.583-08:00</updated><title type='text'>Application Verifier Tool for Windows Mobile 5.0</title><content type='html'>The Application Verifier tool assesses the stability of an application and detects common programming mistakes. The tool can detect and pinpoint memory leaks, handle leaks, and leaks in graphics device interface (GDI) objects. The tool can also detect some forms of heap corruption.&lt;br /&gt;&lt;br /&gt;(&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=D275348A-D937-4D88-AE25-28702C78748D&amp;amp;displaylang=en"&gt;link&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-113993891357164786?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/113993891357164786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=113993891357164786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113993891357164786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113993891357164786'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/02/application-verifier-tool-for-windows.html' title='Application Verifier Tool for Windows Mobile 5.0'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-113955323475217141</id><published>2006-02-09T22:31:00.000-08:00</published><updated>2006-12-21T21:21:33.161-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Threads'/><title type='text'>Lock on this?</title><content type='html'>When writing attempting to write threadsafe code in C#, I'm always debating whether to lock on 'this' or some Object in existence purely for synchronization. Here are a few links contributing to this debate:&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://msdn.microsoft.com/msdnmag/issues/03/01/NET/"&gt;.NET Safe Thread Synchronization&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.yoda.arachsys.com/csharp/threads/lockchoice.shtml"&gt;Lock Choice&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-113955323475217141?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/113955323475217141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=113955323475217141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113955323475217141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113955323475217141'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/02/lock-on-this.html' title='Lock on this?'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-113900388354110737</id><published>2006-02-03T13:57:00.000-08:00</published><updated>2006-12-21T21:22:22.284-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenNETCF'/><title type='text'>Voice Recording with .NET CF</title><content type='html'>&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=223831&amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=223831&amp;amp;SiteID=1&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-113900388354110737?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/113900388354110737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=113900388354110737' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113900388354110737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113900388354110737'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/02/voice-recording-with-net-cf.html' title='Voice Recording with .NET CF'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-113900360195914302</id><published>2006-02-03T13:52:00.000-08:00</published><updated>2006-12-21T21:22:30.150-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenNETCF'/><title type='text'>OpenNet CF 2.0 Beta1 Out Now.</title><content type='html'>&lt;a href="http://www.opennetcf.org/"&gt;http://www.opennetcf.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Power management stuff has been greatly simplified, see:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.opennetcf.org/ctacke/PermaLink,guid,cf2c3926-e875-4a25-b635-39e227b358f5.aspx"&gt;http://blog.opennetcf.org/ctacke/PermaLink,guid,cf2c3926-e875-4a25-b635-39e227b358f5.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-113900360195914302?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/113900360195914302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=113900360195914302' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113900360195914302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113900360195914302'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/02/opennet-cf-20-beta1-out-now.html' title='OpenNet CF 2.0 Beta1 Out Now.'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-113805958095960909</id><published>2006-01-23T15:39:00.000-08:00</published><updated>2006-12-21T21:23:35.293-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Controls'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 2'/><title type='text'>Controls in the .NET Compact Framework</title><content type='html'>Table of Controls supported by .NET CF.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/hf2k718k.aspx"&gt;http://msdn2.microsoft.com/en-us/library/hf2k718k.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-113805958095960909?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/113805958095960909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=113805958095960909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113805958095960909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113805958095960909'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/01/controls-in-net-compact-framework.html' title='Controls in the .NET Compact Framework'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-113803918987130856</id><published>2006-01-23T09:59:00.000-08:00</published><updated>2006-12-21T21:24:26.558-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Downloads'/><title type='text'>Windows Mobile SDKs</title><content type='html'>&lt;p&gt;You will need the &lt;a onclick="javascript:TrackThisClick('ctl00_LibFrame_MainContent_ctl00','ctl00_LibFrame_MainContent_ctl00::ctl00_LibFrame_MainContent_ctl02',this.href);" href="http://go.microsoft.com/fwlink/?linkid=49266"&gt;Windows Mobile Version 5.0 SDK for Pocket PC&lt;/a&gt; and &lt;a onclick="javascript:TrackThisClick('ctl00_LibFrame_MainContent_ctl00','ctl00_LibFrame_MainContent_ctl00::ctl00_LibFrame_MainContent_ctl03',this.href);" href="http://go.microsoft.com/fwlink/?linkid=49270"&gt;Windows Mobile Version 5.0 SDK for Smartphone&lt;/a&gt; to create applications using managed Mobile Direct3D Programming. You also need Windows Mobile Version 5.0 SDK for Smartphone to develop applications using the .NET Compact Framework version 2.0.&lt;/p&gt;&lt;p&gt;Install the SDKs on a computer with Microsoft Visual Studio 2005. When you create a new project, you can choose one of the Windows Mobile 5.0 for Pocket PCand Windows Mobile 5.0 for Smartphone project types and also deploy to Windows Mobile 5.0 emulators.&lt;/p&gt;&lt;p&gt;from &lt;a href="http://msdn2.microsoft.com/en-us/library/ms172552.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms172552.aspx&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-113803918987130856?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/113803918987130856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=113803918987130856' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113803918987130856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113803918987130856'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/01/windows-mobile-sdks.html' title='Windows Mobile SDKs'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-113747397710358074</id><published>2006-01-16T20:47:00.000-08:00</published><updated>2006-12-21T21:24:57.850-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WM 5.0'/><title type='text'>Mobile Edition 5.0 Simplifies</title><content type='html'>Last summer, as a research intern at Intel Research, I suffered through some of the complexities of using unmanaged code to access seemingly rudimentary phone information (e.g. is a call live, current battery level, phone number). With Mobile Edition 5.0, many of these obstacles have been eradicated and a whole slew of new APIs make it easier to do cool thing like Direct3D support, camera APIs, and a generic API for accessing GPS data.&lt;br /&gt;&lt;br /&gt;A summary of stuff I'm looking forward to using:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. State and Notification Broker API&lt;/strong&gt;&lt;br /&gt;Windows Mobile 5.0 devices ship with well over one hundred different state values, which are available through the State and Notification Broker API. The available values provide a wide variety of information regarding the standard Windows Mobile 5.0 applications in addition to the device itself. The following list is just a small sample of the information available through the State and Notification Broker:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The active application &lt;/li&gt;&lt;li&gt;The device's ActiveSync status &lt;/li&gt;&lt;li&gt;Current battery level &lt;/li&gt;&lt;li&gt;Whether a camera is connected to the device &lt;/li&gt;&lt;li&gt;Whether a headset is plugged in &lt;/li&gt;&lt;li&gt;The name of the song currently playing in Media Player &lt;/li&gt;&lt;li&gt;Number of unread SMS messages &lt;/li&gt;&lt;li&gt;Number of unread e-mail messages &lt;/li&gt;&lt;li&gt;Whether a call is currently in progress &lt;/li&gt;&lt;li&gt;Whether a conference call is currently in progress &lt;/li&gt;&lt;li&gt;Whether GPRS connectivity is currently available &lt;/li&gt;&lt;li&gt;Whether the device is currently connected to a VPN &lt;/li&gt;&lt;li&gt;Number of missed phone calls &lt;/li&gt;&lt;li&gt;The name of the phone's mobile operator &lt;/li&gt;&lt;li&gt;Number of tasks due today &lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;2. DirectShow (Camera Support)&lt;/strong&gt;&lt;br /&gt;A rapidly increasing number of mobile devices now include cameras. For developers wanting to create applications that interoperate with these camera-enabled devices, there is the DirectShow API. DirectShow provides application developers the capability to manage and access camera hardware, enabling capture and playback of high-quality pictures and streaming video. DirectShow abstracts the details of individual camera hardware, providing application developers with a common and consistent programming interface.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Direct3D Mobile/Direct Draw&lt;/strong&gt;&lt;br /&gt;Direct3D Mobile is a mobile device implementation of the desktop computer's Direct3D API. Using Direct3D Mobile, developers can use their existing desktop computer Direct3D skills and code to produce rich three-dimensional gaming environments for Windows Mobile devices.  DirectDraw provides mobile developers with a powerful replacement for the Game API (GAPI) allowing applications to take full advantage of hardware capability and performance in addition to providing support for drawing surfaces that developers can easily query.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. GPS Support&lt;/strong&gt;&lt;br /&gt;Many mobile devices now include a GPS either internally or as an attachment. Historically, for applications to access the information a GPS device returned required these applications to use the serial APIs to directly open the GPS device. This technique created two issues. First, working through the serial APIs is relatively code intensive and required the application developer to have at least a moderate knowledge about serial device programming. Second, this architecture limited the receipt of GPS data to the single, currently connected application. Windows Mobile 5.0 eliminates these issues with the GPS Intermediate Driver. The GPS Intermediate Driver provides a very simple-to-use API for providing shared access to GPS data. Through the GPS Intermediate Driver, Windows Mobile greatly reduces the amount of code that is required to interact with a GPS device and allows multiple applications to interrogate the GPS device for configuration and positioning information simultaneously.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;The above list compiled from:&lt;br /&gt;1. &lt;a href="http://msdn.microsoft.com/mobility/windowsmobile/howto/windowsmobile5/api/default.aspx"&gt;What are the New APIs in Windows Mobile 5.0&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/mob5oriwhatsnewinwindowsmobile2003devicedevelopment.asp"&gt;What's New in Windows Mobile Version 5.0&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/mobility/default.aspx?pull=/library/en-us/dnppcgen/html/whatsnew_wm5.asp"&gt;3. What's New for Developers in Windows Mobile 5.0&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-113747397710358074?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/113747397710358074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=113747397710358074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113747397710358074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/113747397710358074'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2006/01/mobile-edition-50-simplifies.html' title='Mobile Edition 5.0 Simplifies'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112472931845147310</id><published>2005-08-22T09:48:00.000-07:00</published><updated>2007-01-11T00:57:59.350-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips/Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Off Topic'/><title type='text'>Convert Unix Time</title><content type='html'>Quick, easy way to convert unix time online:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.onlineconversion.com/unix_time.htm"&gt;http://www.onlineconversion.com/unix_time.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112472931845147310?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112472931845147310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112472931845147310' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112472931845147310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112472931845147310'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/08/convert-unix-time.html' title='Convert Unix Time'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112472703759759563</id><published>2005-08-22T08:57:00.000-07:00</published><updated>2007-01-11T00:58:47.432-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS2005'/><title type='text'>VS2005 Launch Date</title><content type='html'>November 7th is the target launch date of Visual Studio 2005.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112472703759759563?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112472703759759563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112472703759759563' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112472703759759563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112472703759759563'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/08/vs2005-launch-date.html' title='VS2005 Launch Date'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112406965282893035</id><published>2005-08-14T18:28:00.000-07:00</published><updated>2007-01-11T00:59:43.595-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Designer'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><category scheme='http://www.blogger.com/atom/ns#' term='Panels'/><title type='text'>Cool Designer Trick for Panels</title><content type='html'>As far as I know, the VS2005 "Designer Tool" cannot be used with the System.Windows.Forms.Panel class. This can be utterly frustrating when doing layout. So, what I do instead is, first, rename my System.Windows.Forms.Panel derived class to extend System.Windows.Forms.Form. Now I can do my layout with the handy visual "Designer Tool" -- e.g. I right click on the source code and select "View Designer." Once I'm done adding widgets/controls and laying them out, I rename the .Form back to .Panel. Tada!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112406965282893035?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112406965282893035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112406965282893035' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112406965282893035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112406965282893035'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/08/cool-designer-trick-for-panels.html' title='Cool Designer Trick for Panels'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112312723165342982</id><published>2005-08-03T20:37:00.000-07:00</published><updated>2007-01-11T01:02:33.324-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Threads'/><category scheme='http://www.blogger.com/atom/ns#' term='Controls'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><title type='text'>Curiosities of Control.Invoke...</title><content type='html'>I wrote about Control.Invoke(Delegate) once before with regards to the .NET CF restriction that the delegate &lt;strong&gt;&lt;em&gt;must &lt;/em&gt;&lt;/strong&gt;be an instance of the EventHandler. See the &lt;a href="http://csharponphone.blogspot.com/2005/07/controlinvoke-systemargumentexception.html"&gt;original post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I was always curious though about Control.Invoke and whether or not it would act in a comparable manner to firing an event in the normal way (e.g. myEvent(this, EventArgs.Empty)). Is Control.Invoke essentially the same thing? The only obvious difference being that the event execution is transferred to the thread that owns the control's underlying window handle.&lt;br /&gt;&lt;br /&gt;I finally got around to writing a little test util to verify its behavior. My strange conceptual suspicions/thoughts about what it might do were laid to rest and the reality has taken its place. Control.Invoke on an event delegate with multiple subscribers will iterate through each subscriber and fire the event (just as if you fired the event yourself -- in the non-Invoke manner).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112312723165342982?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112312723165342982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112312723165342982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112312723165342982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112312723165342982'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/08/curiosities-of-controlinvoke.html' title='Curiosities of Control.Invoke...'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112312172532151882</id><published>2005-08-03T19:13:00.000-07:00</published><updated>2007-01-11T01:00:48.749-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='GPRS'/><title type='text'>Voice gets precedent</title><content type='html'>In the battle of voice vs. data, voice always wins. It looks like the SmartPhone got it right. If you are currently on a phone call and your app attempts to use GPRS, you receive the following message:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;"Error - Unable to place a data call while a voice call is in progress. When the voice call has ended, try again."&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112312172532151882?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112312172532151882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112312172532151882' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112312172532151882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112312172532151882'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/08/voice-gets-precedent.html' title='Voice gets precedent'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112310808287445599</id><published>2005-08-03T15:27:00.000-07:00</published><updated>2007-01-11T01:02:24.739-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='XDA'/><title type='text'>Command Line Tools for Windows CE</title><content type='html'>&lt;em&gt;A collection of tools to do many things to a windows CE device via Activesync/RAPI.These tools should work on most CE devices, tested on Ipaq, XDA(Wallaby), XDA-II(Himalaya), XDA-IIs(Blueangel), MDA Compact(Magician), i-mate SP3, i-mate SP3i, Yakumo P300, MPx200, Voq, Mitac Mio, Mitac Megas. with PocketPC 2002, PocketPC 2003, Windows Mobile 2003, Windows Mobile 2003 Second Edition, Smartphone 2002, &lt;strong&gt;Smartphone 2003&lt;/strong&gt;. ( wince 3.0 and wince 4.2 ) &lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;br /&gt;Note, that when running on a smartphone, you have to sign itsutils.dll&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;link: &lt;a href="http://www.xs4all.nl/%7Eitsme/projects/xda/tools.html"&gt;http://www.xs4all.nl/~itsme/projects/xda/tools.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112310808287445599?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112310808287445599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112310808287445599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112310808287445599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112310808287445599'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/08/command-line-tools-for-windows-ce.html' title='Command Line Tools for Windows CE'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112310157134934695</id><published>2005-08-03T13:36:00.000-07:00</published><updated>2007-01-11T01:02:05.982-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Phone'/><category scheme='http://www.blogger.com/atom/ns#' term='SIM'/><title type='text'>Where is the phone number stored on the SmartPhone?</title><content type='html'>We've been looking into this issue lately and there are a number of solutions floating around the web. A colleague of mine in the lab has even written a utility to dump SIM storage memory and look for the mobile phone's number. Of course, you could always use the SmsGetPhoneNumber API in the SmartPhone SDK but that's not always guaranteed to work either.&lt;br /&gt;&lt;br /&gt;From Hung Dang at Microsoft,&lt;br /&gt;&lt;br /&gt;&lt;em&gt;You can query the phone number from the device with the SmsGetPhoneNumber API (see Smartphone 2003 SDK).  Note that not all SIM's contain the phone number, so you cannot always get the phone number. &lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;&lt;a href="http://groups-beta.google.com/group/microsoft.public.pocketpc.developer/browse_thread/thread/e62f4270f99b28a8/648e2cf93d93ee00?lnk=st&amp;q=getting+phone+number+from+SIM&amp;amp;amp;rnum=6&amp;amp;hl=en#648e2cf93d93ee00"&gt;Google Groups link.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112310157134934695?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112310157134934695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112310157134934695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112310157134934695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112310157134934695'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/08/where-is-phone-number-stored-on.html' title='Where is the phone number stored on the SmartPhone?'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112285461249466456</id><published>2005-07-31T16:53:00.000-07:00</published><updated>2007-02-19T13:46:26.060-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Registry'/><category scheme='http://www.blogger.com/atom/ns#' term='Audiovox SMT5600'/><title type='text'>Remove mMode Icon from Home Screen</title><content type='html'>Here's how you can remove the mMode Icon from your SMT5600 SmartPhone home screen.&lt;br /&gt;&lt;br /&gt;1. Download a SmartPhone registry editor, I suggest this &lt;a href="http://www.breaksoft.com/Blog/Utilities/2005/1/Mobile_Registry_Editor.aspx"&gt;one&lt;/a&gt;.&lt;br /&gt;2. Open the registry editor and look for the path:&lt;br /&gt;\HKEY_LOCAL_MACHINE\SOFTWARE\AT&amp;T\PluginFavorites&lt;br /&gt;3. Double click on "Order" and remove the mMode.lnk, then click OK.&lt;br /&gt;&lt;p&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center;" alt="" src="http://photos1.blogger.com/blogger/8039/1030/400/remove_mmode_registry1.jpg" border="0" /&gt;&lt;/p&gt;&lt;p&gt;4. Now we need to find a .lnk to replace mMode.lnk. Open up \HKEY_CURRENT_USER\Software\Microsoft\Shell\StartMenu to see a list of .lnk replacements. In this case, I will choose "Call History.lnk"&lt;br /&gt;5. Go back to \HKEY_LOCAL_MACHINE\SOFTWARE\AT&amp;T\PluginFavorites and add this new .lnk&lt;/p&gt;&lt;p&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center;" alt="" src="http://photos1.blogger.com/blogger/8039/1030/400/remove_mmode_registry_call_history1.jpg" border="0" /&gt;6. Restart your phone.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112285461249466456?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112285461249466456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112285461249466456' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112285461249466456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112285461249466456'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/07/remove-mmode-icon-from-home-screen.html' title='Remove mMode Icon from Home Screen'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112269646458876771</id><published>2005-07-29T21:05:00.000-07:00</published><updated>2007-02-19T13:47:04.106-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TextBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Cursor'/><title type='text'>C# Set Cursor Position in Textbox</title><content type='html'>How does one go about setting the cursor position in a .NET CF TextBox?&lt;br /&gt;&lt;br /&gt;You use a combination of the TextBox.SelectionStart and TextBox.SelectionLength.&lt;br /&gt;&lt;br /&gt;For example,&lt;br /&gt;&lt;br /&gt;&lt;em&gt;private void textBox1_GotFocus(object sender, System.EventArgs e)&lt;br /&gt;{&lt;br /&gt;textBox1.SelectionStart = 5;&lt;br /&gt;textBox1.SelectionLength = 0;&lt;br /&gt;}&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;from &lt;a href="http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/339c1961be9ea9fc/9f7aacbea417b273?q=cursor+position+in+textbox&amp;rnum=9&amp;amp;hl=en#9f7aacbea417b273"&gt;groups.google&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112269646458876771?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112269646458876771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112269646458876771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112269646458876771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112269646458876771'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/07/c-set-cursor-position-in-textbox.html' title='C# Set Cursor Position in Textbox'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112262360913015572</id><published>2005-07-29T00:52:00.000-07:00</published><updated>2007-02-19T13:47:21.803-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='strings'/><title type='text'>C# String Formatting Resources</title><content type='html'>Here are two incredibly useful string formatting resources, including how to do variable-width string alignment in C#.&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://www.stevex.org/CS/blogs/dottext/articles/158.aspx"&gt;http://www.stevex.org/CS/blogs/dottext/articles/158.aspx&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.codeproject.com/books/0735616485.asp"&gt;http://www.codeproject.com/books/0735616485.asp&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112262360913015572?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112262360913015572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112262360913015572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112262360913015572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112262360913015572'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/07/c-string-formatting-resources.html' title='C# String Formatting Resources'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112224914839608305</id><published>2005-07-24T16:51:00.000-07:00</published><updated>2007-02-19T13:48:06.618-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Singeltons'/><category scheme='http://www.blogger.com/atom/ns#' term='Threads'/><title type='text'>Thread Safe Singleton</title><content type='html'>&lt;em&gt;Typical WinForms applications are typically running in the UI thread, so the simple singleton will provide you with the functionality that you're looking for. However, if you are creating a multi-threaded application that needs to access a singleton across all of its threads, then you will need to create a thread-safe singleton class instead. What you gain in functionality comes at the cost of some performance, so you shouldn't use this form of the class unless you actually intend to use the class from multiple threads.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=486"&gt;Thread Safe Singleton Code&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112224914839608305?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112224914839608305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112224914839608305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112224914839608305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112224914839608305'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/07/thread-safe-singleton.html' title='Thread Safe Singleton'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112216561455963134</id><published>2005-07-23T17:38:00.000-07:00</published><updated>2007-02-19T13:48:11.478-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Threads'/><title type='text'>No Thread.Abort() in .NET CF 1.0</title><content type='html'>You cannot call Thread.Abort() in .NET CF 1.0, so how do you close/stop a thread?&lt;br /&gt;&lt;br /&gt;See this &lt;a href="http://msdn.microsoft.com/mobility/understanding/articles/default.aspx?pull=/library/en-us/dncfhowto/html/stopmt.asp"&gt;HOWTO &lt;/a&gt;on msdn for a workaround.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112216561455963134?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112216561455963134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112216561455963134' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112216561455963134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112216561455963134'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/07/no-threadabort-in-net-cf-10.html' title='No Thread.Abort() in .NET CF 1.0'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112208415582806838</id><published>2005-07-22T19:00:00.000-07:00</published><updated>2007-02-19T13:48:24.524-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='P/Invoke'/><category scheme='http://www.blogger.com/atom/ns#' term='Memory'/><title type='text'>Obtaining Memory Status w/C#</title><content type='html'>&lt;a name="6.5"&gt;&lt;strong&gt;&lt;em&gt;6.5. How do I determine how much memory a device has available?&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;You can P/Invoke the GetSystemMemoryDivision and GlobalMemorySystem functions to determine how the memory is divided and allocated between program and storage. Definitions of the parameters can be found in the API reference documentation.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;from our friendly &lt;a href="http://msdn.microsoft.com/smartclient/understanding/netcf/FAQ/default.aspx"&gt;Smart Client Developer FAQ on msdn&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112208415582806838?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112208415582806838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112208415582806838' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112208415582806838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112208415582806838'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/07/obtaining-memory-status-wc.html' title='Obtaining Memory Status w/C#'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112208049445771210</id><published>2005-07-22T18:00:00.000-07:00</published><updated>2007-02-19T13:49:01.681-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET CF 1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><title type='text'>Control.Invoke System.ArgumentException</title><content type='html'>Even though I'd read this before, I'd forgotten about it and it caused me a slight headache today. If you call Control.Invoke on a custom event delegate which is not EventHandler, you will receive a System.ArgumentException.&lt;br /&gt;&lt;br /&gt;From msdn,&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Platform Note: In .NET Compact Framework applications, the delegate must be an instance of EventHandler. For an example, see How to: Use a Custom Delegate.&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112208049445771210?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112208049445771210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112208049445771210' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112208049445771210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112208049445771210'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/07/controlinvoke-systemargumentexception.html' title='Control.Invoke System.ArgumentException'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112207838925793540</id><published>2005-07-22T17:25:00.000-07:00</published><updated>2007-02-19T13:49:27.266-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='Line Counting'/><title type='text'>Efficiently Counting Lines in a File</title><content type='html'>&lt;a id="viewpost.ascx_TitleUrl" href="http://weblogs.asp.net/justin_rogers/articles/115345.aspx"&gt;Fast absolute, and statistical line counting algorithms for use with progress notification&lt;/a&gt;&lt;a href="http://weblogs.asp.net/justin_rogers/articles/115345.aspx"&gt; &lt;/a&gt;by Justin Rogers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112207838925793540?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112207838925793540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112207838925793540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112207838925793540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112207838925793540'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/07/efficiently-counting-lines-in-file.html' title='Efficiently Counting Lines in a File'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13472432.post-112201836274248844</id><published>2005-07-22T00:45:00.000-07:00</published><updated>2007-02-19T13:49:36.340-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><title type='text'>Creating a multi-form app on SmartPhone</title><content type='html'>Creating a Multiple Form Application Framework for the Microsoft .NET Compact Framework by Chris Tacke on &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/casoast.asp"&gt;msdn&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13472432-112201836274248844?l=csharponphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharponphone.blogspot.com/feeds/112201836274248844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=13472432&amp;postID=112201836274248844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112201836274248844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13472432/posts/default/112201836274248844'/><link rel='alternate' type='text/html' href='http://csharponphone.blogspot.com/2005/07/creating-multi-form-app-on-smartphone.html' title='Creating a multi-form app on SmartPhone'/><author><name>jonfroehlich</name><uri>http://www.blogger.com/profile/15642573762258876817</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://abstract.cs.washington.edu/~jfroehli/images/mugs_justme/mug_sf_trolley_ca.jpg'/></author><thr:total>0</thr:total></entry></feed>
