<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Where are we going, and what's with the handbasket? : ce</title><link>http://blogs.msdn.com/dcook/archive/tags/ce/default.aspx</link><description>Tags: ce</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Introduction to the Catalog Object Model</title><link>http://blogs.msdn.com/dcook/archive/2007/12/18/introduction-to-the-catalog-object-model.aspx</link><pubDate>Wed, 19 Dec 2007 00:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6800374</guid><dc:creator>dcook</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dcook/comments/6800374.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dcook/commentrss.aspx?PostID=6800374</wfw:commentRss><description>&lt;P&gt;Today's post will&amp;nbsp;provide a&amp;nbsp;basic introduction to the&amp;nbsp;Windows Embedded CE Platform Builder Catalog. If you don't know what that is, consider yourself lucky. If you do have to deal with the catalog data, today's post might be helpful.&amp;nbsp;We'll write a quick C# utility that demonstrates the catalog object model and also provides some useful diagnostic information that might be helpful to catalog file authors.&amp;nbsp;The tool will display any errors or warnings that PB encounters while loading the catalog. It will also list all of the catalog files that it was able to load.&lt;/P&gt;
&lt;P&gt;I don't really know how it happened, but somehow about 5 years ago, through no fault of my own, I ended up owning the PB "catalog". For those who don't know, the catalog is a repository for information about the CE operating system, and PB uses this information to help developers customize their CE builds. For example, if you have the environment variable "SYSGEN_AUDIO" set when you build a CE operating system, your operating system will include sound system support. The catalog has a list of these "features", along with a friendly title, description, and some metadata that helps PB ensure that the environment variable is properly exposed to the developer.&lt;/P&gt;
&lt;P&gt;There were some significant issues with the catalog's design, and maintaining the catalog data was not a fun experience. CEC files were not &amp;nbsp;Maintaining the code that worked with the catalog was also problematic. For PB 6.0, I finally had the opportunity to start from scratch with a new catalog format. While a certain amount of backwards compatibility was required (the new catalog needed to essentially provide the same data as the old one, and there would need to be an upgrade path). So I designed a new catalog system, written in C# and based on XML files. While it isn't perfect, I think it is an improvement.&lt;/P&gt;
&lt;P&gt;From a development perspective, one thing that is nice about the new catalog is that it has a pretty clean object model (an interface for developers who want to use the catalog). While we've never published the interface for the object model, we don't support it for external use, and everything I say here comes without warrantee or guarrantee of future compatibility, it isn't too hard to get started with basic tasks using the catalog object model. The reflection and metadata included in every managed assembly make this possible.&lt;/P&gt;
&lt;P&gt;Before I go too far, I want to be clear that the design for the catalog object model&amp;nbsp;emphasized the most common use of the catalog as a read-only repository. Loading and reading data from the catalog is (hopefully) reasonably simple and efficient. Using the object model to create or edit catalog files is a bit more of a challenge and not quite as efficient.&lt;/P&gt;
&lt;P&gt;Loading a catalog means parsing about 2 megabytes of XML and loading the data into memory. While this happens in less than 1/10 of a second, we don't want to do this too often. In addition, we don't usually need (or want)&amp;nbsp;multiple copies of the catalog in memory. To help with this, the catalog object model provides a cache of read-only loaded catalogs. When loading a catalog via the object model, you can choose to get your own copy of the catalog or you can ask for a read-only copy, which may come from the cache. (The cache is based on the .NET garbage collector via weak references. As long as anybody is using a catalog, it won't be evicted from the cache. As soon as nobody is using it, it becomes eligible for garbage collection. If it re-enters use before it is collected, it is no longer eligible for collection.)&lt;/P&gt;
&lt;P&gt;The first step in using the catalog from your own code is to reference the catalog library. This code is in the Microsoft.PlatformBuilder.Catalog assembly, which (assuming you've installed Platform Builder 6 into C:\Program Files)&amp;nbsp;can be found in C:\Program Files\Microsoft Platform Builder\6.00\cepb\idevs\Microsoft.PlatformBuilder.Catalog.dll. In Visual Studio, add a reference to this file. For convenience, you can add a "using" declaration to the top of your code to import the Catalog's namespace:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; FONT-FAMILY: Monospace; BACKGROUND-COLOR: white"&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Microsoft.PlatformBuilder.Catalog;&lt;/SPAN&gt; &lt;/DIV&gt;
&lt;P&gt;Next, to load a catalog, you use the CatalogManager class. The CatalogManager is a collection of catalog files. It handles searching through a winceroot for catalog files to load, loading all of the catalog files into memory, and maintaining the organization of the data in the catalog. It "flattens" the contents of the files, merging the data from all of the catalog files into a single collection of catalog elements. It also groups the data by type (so I can get a list of BSPs without going through all elements in the whole catalog), and generates indexes (so I can quickly look up a BSP by name).&lt;/P&gt;
&lt;P&gt;When creating a CatalogManager, you can either create your own (writable) copy or you can load a read-only cached copy that might be shared by other components in the same process. To create a writable copy, just use the CatalogManager's constructor:&lt;/P&gt;&lt;FONT size=3&gt;
&lt;P&gt;&lt;FONT face=Monospace size=-1&gt;&lt;FONT color=#2b91af&gt;CatalogManager&lt;/FONT&gt;&lt;FONT color=black&gt; catalog = &lt;/FONT&gt;&lt;FONT color=blue&gt;new&lt;/FONT&gt;&lt;FONT color=black&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af&gt;CatalogManager&lt;/FONT&gt;&lt;FONT color=black&gt;();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;The default constructor for the CatalogManager will load only the "Global" catalog files. These are the catalog files in C:\Program Files\Microsoft Platform Builder\6.00\Catalog, and need to be available to PB whether or not it is working with a CE OS tree. To load the catalog files from an OS tree as well as the global catalog files, just add the winceroot path to the constructor call:&lt;/P&gt;&lt;SPAN style="COLOR: #2b91af"&gt;
&lt;DIV style="FONT-SIZE: 10pt; FONT-FAMILY: Monospace; BACKGROUND-COLOR: white"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogManager&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; catalog = &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogManager&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;@"C:\wince600"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/SPAN&gt;If you don't need to make changes to the catalog manager's data and don't need precise control over the load sequence, you can use the CatalogManager factory method. This will return a cached catalog if one is available, so it is&amp;nbsp;usually more efficient for repeated use&amp;nbsp;than creating and loading a new catalog each time.&lt;/P&gt;&lt;FONT color=#2b91af size=3&gt;&lt;FONT color=#000000 size=2&gt;
&lt;DIV style="FONT-SIZE: 10pt; FONT-FAMILY: Monospace; BACKGROUND-COLOR: white"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogManager&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; catalog = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogManager&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.GetCatalogManager(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;@"C:\wince600"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;Next, we want to know if the catalog manager had any trouble while loading the catalog. For normal operation,&amp;nbsp;developers generally&amp;nbsp;don't want a defective catalog file to prevent PB from working correctly, so the catalog manager will silently catch catalog load errors. However, when working on catalog files, it is helpful to know what PB really thinks about your catalog. The catalog manager keeps track of warnings and errors generated during catalog load. You can access the errors via the catalog manager's Messages property, which is a read-only collection of CatalogMessage objects.&lt;/P&gt;
&lt;P&gt;The catalog manager also provides a utility method to format the error or warning messages. It will then write the messages to any TextWriter (i.e. a StreamWriter or&amp;nbsp;StringWriter). For example, to print all error or warning messages to stdout, you could do this:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; FONT-FAMILY: Monospace; BACKGROUND-COLOR: white"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogManager&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.WriteCatalogMessages(catalog.Messages, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.Out);&lt;/SPAN&gt; &lt;/DIV&gt;
&lt;P&gt;Finally, we want to access some of the data in the catalog. Let's print out a list of all of the catalog files that were successfully loaded:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; FONT-FAMILY: Monospace; BACKGROUND-COLOR: white"&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogFile&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; file &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; catalog.Files)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.WriteLine(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"CatalogFile: {0} - \"{0}\""&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;file.FileInformation.Title, file.FullName);&lt;BR&gt;}&lt;BR&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;SPAN style="COLOR: black"&gt;Similar collections exist for the BSPs, CPUs, and "Items" in the catalog.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;SPAN style="COLOR: black"&gt;Here is a simple command-line program that pulls this all together. You can build this via a Visual Studio C# command-line app project, or you can compile this at the command line with the csc.exe C# compiler. The only trick is to add a reference to the Microsoft.PlatformBuilder.Catalog.dll assembly (from C:\Program Files\Microsoft Platform Builder\6.00\cepb\idevs).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;SPAN style="COLOR: black"&gt;Have fun!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;SPAN style="COLOR: black"&gt;
&lt;DIV style="FONT-SIZE: 10pt; FONT-FAMILY: Monospace; BACKGROUND-COLOR: white"&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; System;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; System.IO;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Microsoft.Win32;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Microsoft.PlatformBuilder.Catalog;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; CatalogErrors&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Program&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Main(&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;[] args)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;try&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; winceroot = &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (args.Length &amp;gt; 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; arg0 = args[0].ToLowerInvariant();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (arg0 != &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"/?"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &amp;amp;&amp;amp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arg0 != &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"-?"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &amp;amp;&amp;amp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arg0 != &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"/h"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &amp;amp;&amp;amp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arg0 != &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"-h"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &amp;amp;&amp;amp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arg0 != &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"--help"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;winceroot = args[0];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;else&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;winceroot = GetDefaultWinceroot();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (winceroot != &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &amp;amp;&amp;amp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;!&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Directory&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.Exists(winceroot))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.Error.WriteLine(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"ERROR: Winceroot \"{0}\" not found."&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;winceroot);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;winceroot = &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (winceroot == &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.Error.WriteLine(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Usage: CatalogErrors [winceroot]"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.Error.WriteLine(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Displays any CE catalog load warnings and errors."&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.Error.WriteLine(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"If winceroot is not specified, uses default from registry."&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;else&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Run(winceroot);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;catch&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Exception&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; ex)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.Error.WriteLine(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"ERROR: {0}: {1}{2}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ex.GetType().FullName,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ex.Message,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ex.StackTrace);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ex = ex.InnerException;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;while&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (ex != &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.Error.WriteLine(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {0}: {1}{2}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ex.GetType().FullName,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ex.Message,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ex.StackTrace);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; GetDefaultWinceroot()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; winceroot = &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RegistryKey&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; localDir = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Registry&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.CurrentUser.OpenSubKey(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;@"Software\Microsoft\Platform Builder\6.00\Directories"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (localDir != &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;winceroot = localDir.GetValue(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"OS Install Dir"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;) &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (winceroot == &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RegistryKey&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; globalDir = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Registry&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.CurrentUser.OpenSubKey(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;@"Software\Microsoft\Platform Builder\6.00\Directories"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (globalDir != &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;winceroot = globalDir.GetValue(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"OS Install Dir"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;) &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; winceroot;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; Run(&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; winceroot)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogManager&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; catalog =&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogManager&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.GetCatalogManager(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;@"C:\wince600"&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogManager&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.WriteCatalogMessages(catalog.Messages, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.Out);&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CatalogFile&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; file &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt; catalog.Files)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;.WriteLine(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"CatalogFile: {0} - \"{0}\""&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;file.FileInformation.Title, file.FullName);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;}&lt;BR&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6800374" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dcook/archive/tags/pb/default.aspx">pb</category><category domain="http://blogs.msdn.com/dcook/archive/tags/ce/default.aspx">ce</category><category domain="http://blogs.msdn.com/dcook/archive/tags/platform+builder/default.aspx">platform builder</category><category domain="http://blogs.msdn.com/dcook/archive/tags/pbcxml/default.aspx">pbcxml</category><category domain="http://blogs.msdn.com/dcook/archive/tags/catalog/default.aspx">catalog</category></item><item><title>Missing OS Design View tab in PB 5.0</title><link>http://blogs.msdn.com/dcook/archive/2007/09/11/missing-os-design-view-tab-in-pb-5-0.aspx</link><pubDate>Wed, 12 Sep 2007 01:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4872119</guid><dc:creator>dcook</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/dcook/comments/4872119.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dcook/commentrss.aspx?PostID=4872119</wfw:commentRss><description>&lt;P&gt;A common complaint about PB 5.0 is that&amp;nbsp;the OS Design View tab will sometimes mysteriously&amp;nbsp;disappear. The best answer I have is that&amp;nbsp;people should be using PB 6.0. Unfortunately, that answer tends to make people want to punch me. In the interest of my own safety, here is what I know about alternative methods of resolving the problem.&lt;/P&gt;
&lt;P&gt;The OS Design View tab is one of the places where the old PB shell code (VS 6.0 vintage 1998) meets up with the new PB object model (totally re-written and designed for integration with the VS 2005 shell).&amp;nbsp;So this&amp;nbsp;is more evidence that you can't put new wine in old bottles -- you'll almost always end up with leaks.&lt;/P&gt;
&lt;P&gt;In the case of the OS Design View, most of the issues I've resolved were due to an exception leaking. Exception handling is a great thing, but it has the good/bad quality that it is often easy to forget that you're calling a function that can throw an exception (good when you don't need to handle it, bad when you do...).&lt;/P&gt;
&lt;P&gt;Ideally, the exception will be caught by PB and PB will properly recover and/or display a useful error message, but this doesn't always happen, in which case PB just silently fails or crashes. Luckily, the exception type we use does a little bit of logging. The exception constructor will send a quick message to the system debug stream. Sometimes this message is useless, but every once in a while, the exception has enough information to help you track down the problem.&lt;/P&gt;
&lt;P&gt;There are several utilities that can monitor the debug stream. DBMon.exe is a simple console tool that is part of the Microsoft Platform SDK. &lt;A class="" href="http://www.microsoft.com/technet/sysinternals/Miscellaneous/DebugView.mspx" mce_href="http://www.microsoft.com/technet/sysinternals/Miscellaneous/DebugView.mspx"&gt;DebugView&lt;/A&gt; can be downloaded from the &lt;A class="" href="http://www.microsoft.com/technet/sysinternals/default.mspx" mce_href="http://www.microsoft.com/technet/sysinternals/default.mspx"&gt;SysInternals&lt;/A&gt; website. If you run cepb.exe under a debugger such as &lt;A class="" href="http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx" mce_href="http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx"&gt;WinDbg&lt;/A&gt; or Visual Studio, you'll also see the messages from the debug stream.&lt;/P&gt;
&lt;P&gt;In the case of Missing OS Design View tabs, I have occasionally been able to track down the problem by monitoring the system debug stream while opening an OS Design (pbxml). For example, I saw an "Access Denied" exception that occurred while trying to open a file in&amp;nbsp;an OS Design. The exception message included the file name. Removing the "Read Only" attribute from the file allowed me to successfully open the OS Design.&lt;/P&gt;
&lt;P&gt;Obviously, this is a problem with PB. PB should probably be able to do its job with read-only access to the file. And if it fails, it should at least pop up a useful error message indicating what the problem was. Hopefully, we'll do better in the future. In the meantime, you can try to identify the file that is causing trouble for PB and remove the read-only attribute. While this might cause trouble for your source control system, you'll hopefully at least be able to get back to work.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Start&amp;nbsp;a debug stream monitor utility such as DbMon.exe or DebugView, then start cepb.exe. Alternatively, launch cepb.exe under a debugger such as Visual Studio or WinDbg.&lt;/LI&gt;
&lt;LI&gt;Recreate the scenario that is causing trouble. For example, if the OS Design View tab is missing when you&amp;nbsp;open&amp;nbsp;a particular OS Design, open that OS Design.&lt;/LI&gt;
&lt;LI&gt;Examine the messages logged to the debug output stream.&lt;/LI&gt;
&lt;LI&gt;If you find any messages that look interesting, try to resolve the problem they indicate. For example, if you see that one of the messages refers to an access denied failure when opening a particular file, verify that the file exists and that you can access the file. If the file is read-only, try removing the read-only attribute from the file using Explorer (right-click on the file and select "Properties") or the DOS Attrib command.&lt;/LI&gt;
&lt;LI&gt;Leave a comment below or &lt;A class="" title="Contact Doug" href="http://blogs.msdn.com/dcook/contact.aspx" mce_href="http://blogs.msdn.com/dcook/contact.aspx"&gt;contact me&lt;/A&gt; to let me know if this does or does not work for you!&lt;/LI&gt;&lt;/OL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4872119" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dcook/archive/tags/pb/default.aspx">pb</category><category domain="http://blogs.msdn.com/dcook/archive/tags/ce/default.aspx">ce</category><category domain="http://blogs.msdn.com/dcook/archive/tags/platform+builder/default.aspx">platform builder</category><category domain="http://blogs.msdn.com/dcook/archive/tags/os+design+view/default.aspx">os design view</category></item><item><title>Does PB 5.0 work side-by-side with PB 6.0?</title><link>http://blogs.msdn.com/dcook/archive/2007/05/13/does-pb-5-0-work-side-by-side-with-pb-6-0.aspx</link><pubDate>Mon, 14 May 2007 02:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2612410</guid><dc:creator>dcook</dc:creator><slash:comments>17</slash:comments><comments>http://blogs.msdn.com/dcook/comments/2612410.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dcook/commentrss.aspx?PostID=2612410</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Hey, PB expert guy, I have a question.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Shoot.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Can I run PB 5.0 side-by-side with PB 6.0?&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Short answer or long answer?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Um, short answer, please.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Kind-of.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;What kind of answer is that? This is a yes-or-no question!&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Ok. Then the answer is no.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;That’s not what I wanted to hear.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Oh, sorry. The customer is always right, I forgot. Yes, yes, of course&amp;nbsp;you can.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Are you lying to me?&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Technically, no.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;I want the truth.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can’t handle the truth.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Ha ha. Very funny.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well, you can run them side by side, but you may or may not be happy with the results.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Hmm. You’re weaseling out of the question, aren’t you?&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yup. Weaseling is what separates us from the animals. (Except the weasel.)&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Ok, then the long answer please?&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sure. But first, recognize that the following information is offered without any warrantee or guarantee. You follow these instructions at your own risk. Neither Microsoft nor dcook accepts any responsibility for the use or misuse of these instructions. Use at your own risk. Back up your data first. I’m sharing this information because it has helped others, but it may or may not help you.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Yes, I accept. (click.)&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Platform Builder 5.0 and 6.0 tools do not always work perfectly when both are installed on the same computer. (Note that this refers to the PB IDE and tools, not to the OS build tree. The build tree is fairly self-contained.) Most things work, but there are a few challenges. There are also a few steps you can take to minimize the challenges.&lt;/P&gt;
&lt;P&gt;The first thing to know is that you must install PB 5.0 first. If you’ve already installed PB 6.0, I’m sorry, but you'll have to uninstall it. PB 5.0 broke some installation rules and will clobber some PB 6.0 settings. And there are a few things that PB 6.0 had to do that aren’t pretty, so a repair of PB 6.0 might not work either. If you’ve already installed PB 6.0 and want to install PB 5.0, your best bet is to uninstall PB 6.0 first. Here is the recommended order of installation:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Install PB 5.0.&lt;/LI&gt;
&lt;LI&gt;Make a backup copy of all files in C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\Platman\bin. (Only the files in the bin folder need to be backed up. The subfolders do not need to be saved.)&lt;/LI&gt;
&lt;LI&gt;Install Visual Studio 2005 and all associated service packs (as of this writing, SP1, and if you’re running Vista, the SP1-Vista-GDR).&lt;/LI&gt;
&lt;LI&gt;Install PB 6.0 and all associated service packs (as of this writing, SP1).&lt;/LI&gt;
&lt;LI&gt;Compare the current set of files in the Platman\bin folder with the set of files you backed up. Restore any missing files. (Do NOT overwrite any existing files.)&lt;/LI&gt;
&lt;LI&gt;If you have any Connection Manager device settings that were created with PB 5.0, you’ll need to delete them and recreate them.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;At this point, PB 5.0 and PB 6.0 should both be mostly working – or at least as well as can be expected.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;What’s that supposed to mean?&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well, the above steps worked for me. But there are all kinds of things that could go wrong, and I may not have tested some aspect of PB that is important to you, so this may not work perfectly for everybody.&lt;/P&gt;
&lt;P&gt;The largest trouble spots are with the x86 Emulator, the Remote Tools (especially PerfMon and CeCap), and with CoreCon (download and KITL transports).&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Why is this such a problem in the first place? Why don’t you just fix this mess?&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would love nothing better than to fix this mess. Unfortunately, as long as we support cemgr.exe, we’re going to have some side-by-side troubles with the Platman\bin folder. Back in PB 4.0, when the best practices for MSI development were not nearly as well-known as they are today (and they still aren't&amp;nbsp;very well-known), a few mistakes were made in the development of the PB 4.0 Platman install. The result is that if a file was part of the PB 4.0 Platman install in the Platman\bin folder, and we want that file to still exist after PB 6.0 is installed, we have to include that file in PB 6.0. Due to various security and legal issues, there are a few files that were part of PB 4.0 that we can no longer ship in PB 6.0. As a result, installing PB 6.0 causes these files to mysteriously disappear.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Any other issues?&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yeah. If you uninstall either PB 5.0 or PB 6.0, you’ll probably have to repair the remaining version of PB before it runs correctly (Add/Remove Programs, select PB, then select Repair). Certain registry settings&amp;nbsp;for COM interfaces can't really be properly shared between versions of PB.&lt;/P&gt;
&lt;P&gt;Also, the CoreCon datastore is a bit more fragile than I would have liked. Sometimes things go wrong with the datastore resulting in problems when you launch Connection Settings from PB or when you try to create a Visual Studio for Devices project. (You may also run into problems while installing PB 6.0 if your datastore is corrupt.) If you have trouble with the CoreCon datastore, try the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;1. You can safely delete your local (per-user) CoreCon datastore settings. (See &lt;A href="http://msdn2.microsoft.com/en-us/library/ms184403(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms184403(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms184403(VS.80).aspx&lt;/A&gt; for details.) This sometimes fixes issues with launching Connection Settings or with creating VSD projects. Go to your user’s application data directory, navigate to the Microsoft folder, and delete the CoreCon directory. For example, 'rd /s "C:\Documents and Settings\YourUserName\Local Settings\Application Data\Microsoft\CoreCon" '. (Warning: DO NOT delete the CoreCon settings under All Users!) The next time you activate CoreCon, it will rebuild your per-user datastore. You will lose any devices that you may have configured, but it shouldn't be too hard to recreate them.&lt;/LI&gt;
&lt;LI&gt;2. If the above does not help, you may have a problem with your global (all users) CoreCon datastore settings. This is a hard problem to solve. These files are in the All Users application data area (i.e. C:\Documents and Settings\All Users\Application Data\Microsoft\CoreCon\1.0, or C:\ProgramData\Microsoft\CoreCon\1.0 on Vista). You can’t just delete these files and hope they come back (because they won’t). This might work:&lt;/LI&gt;
&lt;OL&gt;
&lt;LI&gt;Make a backup copy of the data in the CoreCon\1.0 folder.&lt;/LI&gt;
&lt;LI&gt;No, seriously. Make a backup copy. If you lose the data in this folder, it may be quite difficult to get it back.&lt;/LI&gt;
&lt;LI&gt;Rename the 1.0 folder to something else, like “1.0_original”.&lt;/LI&gt;
&lt;LI&gt;If a friend or co-worker has a working installation with a similar set of programs (i.e. they successfully installed PB 5.0, VS 2005, and PB 6.0), try copying the data from the other computer to your computer. Ensure that you’ve deleted the per-user CoreCon data (step 1 above), then launch PB 5.0 or VS 2005 and try to open Connection Settings.&lt;/LI&gt;
&lt;LI&gt;If this doesn’t work, rename this folder out of the way (i.e. rename it to 1.0_from_other_computer), then try a repair install of PB 5.0, then VS 2005, then PB 6.0.&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Yikes!&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yeah. Tell me about it.&lt;/P&gt;
&lt;P&gt;Some people have had better luck just installing PB 5.0 and 6.0 on separate machines, dual-booting, or even installing PB 5.0 into a Virtual PC image.&lt;/P&gt;
&lt;P&gt;There are also ways to make PB 6.0 work with OS trees from CE 5.0, but that is a more complicated subject (and while it generally works, it is definitely unsupported by Microsoft).&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2612410" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dcook/archive/tags/pb/default.aspx">pb</category><category domain="http://blogs.msdn.com/dcook/archive/tags/ce/default.aspx">ce</category><category domain="http://blogs.msdn.com/dcook/archive/tags/corecon/default.aspx">corecon</category><category domain="http://blogs.msdn.com/dcook/archive/tags/side-by-side/default.aspx">side-by-side</category></item><item><title>Changes in Nmake 8.0</title><link>http://blogs.msdn.com/dcook/archive/2007/03/20/changes-in-nmake-8-0.aspx</link><pubDate>Wed, 21 Mar 2007 05:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1922803</guid><dc:creator>dcook</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dcook/comments/1922803.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dcook/commentrss.aspx?PostID=1922803</wfw:commentRss><description>&lt;P&gt;I've run into this issue twice now&amp;nbsp;(in different forms) after upgrading build systems from old versions of Nmake to Nmake 8.0 (the version from Visual Studio 2005), so I think that means it's time to blog about it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Scenario 1:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Your stuff builds ok, but the output is totally wrong. Characters are missing from the output, and during the build, your computer keeps beeping at you.&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;Compiling .._koho.c ..\gaimem.c ..\k_area.c ..\k_clearn.c ..\k_grbg.c ..\k_hnkn.c&lt;BR&gt;..\k_moji.c ..\k_regist.c . evconv.c ..♂lbmgr.c ..nvdbg.c ..\k_frame.c&lt;BR&gt;..\k_kenti.c ..\k_disp.c ..\k_atwid.c ..\k_crsr.c ..\k_kkti.c .. ngmgr.c&lt;BR&gt;..\k_koho.c ..\k_bun mk.c ..comment.c ..utotune.c .. &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Investigating, you find that all of the missing characters are C-style escape sequences - "\a", "\r", "\n", etc., and the escape sequences have been replaced by the corresponding control code - beep, CR, LF, etc. So why did nmake suddenly decide to start processing escape codes?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Scenario 2:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The following is something of an idiom for makefiles. It shows the command line that is about to be executed, then executes it. (This is&amp;nbsp;a bit of&amp;nbsp;a simplification. As presented, this serves no purpose, but&amp;nbsp;the pattern&amp;nbsp;becomes useful when inline response files are involved.)&lt;/P&gt;&lt;CODE&gt;.cpp.obj:&lt;BR&gt;&amp;nbsp; @type &amp;lt;&amp;lt;&lt;BR&gt;&amp;nbsp; $(CL_COMMAND_LINE)&lt;BR&gt;&amp;lt;&amp;lt;NOKEEP&lt;BR&gt;&amp;nbsp; $(CL_COMMAND_LINE) &lt;/CODE&gt;
&lt;P&gt;After upgrading to Nmake 8.0, this starts causing an error. Type complains that it can't find the temporary inline file. Replacing "type" with "cmd /c type" fixes the problem.&lt;/P&gt;
&lt;P&gt;Both issues have essentially the same root cause. Tune in next time for the solution.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1922803" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dcook/archive/tags/ce/default.aspx">ce</category><category domain="http://blogs.msdn.com/dcook/archive/tags/nmake/default.aspx">nmake</category><category domain="http://blogs.msdn.com/dcook/archive/tags/build/default.aspx">build</category></item><item><title>What is Platform Builder?</title><link>http://blogs.msdn.com/dcook/archive/2007/03/11/what-is-platform-builder.aspx</link><pubDate>Sun, 11 Mar 2007 12:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1858009</guid><dc:creator>dcook</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dcook/comments/1858009.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dcook/commentrss.aspx?PostID=1858009</wfw:commentRss><description>&lt;P&gt;I work in the Windows Embedded CE group on the "PB IDE tools" team. That might take a bit of explaining. (Sometimes, I'm not entirely clear myself.)&lt;/P&gt;
&lt;P&gt;CE is the "miniature"&amp;nbsp;version of Windows. (The big version,&amp;nbsp;referred to as&amp;nbsp;"NT" on this blog, is&amp;nbsp;familiar to most people&amp;nbsp;--&amp;nbsp;nearly everybody knows what I mean when I talk about Windows&amp;nbsp;2000, XP, or Vista.)&amp;nbsp;When talking to family members and friends, I get the most success by explaining it as&amp;nbsp;"the operating system that runs Pocket PCs and SmartPhones". That's accurate (assuming they don't confuse it with PalmOS or their Nokia cell phone), but not a complete description. The CE operating system is actually used in a lot of other things such as industrial automation,&amp;nbsp;GPS navigation systems, and routers. While skiing with my sister's husband, I was trying to explain this and I noticed that the little barcode scanners they were using to scan our lift tickets were running CE, so that made it a bit easier to explain. In any case, CE tends to be used in computerized components that are&amp;nbsp;used as "devices" or "appliances" and not "computers".&lt;/P&gt;
&lt;P&gt;I am a member of the "IDE Tools" team.&amp;nbsp;Officially,&amp;nbsp;this means that my team is responsible for the Platform Builder&amp;nbsp;shell and project system used to develop for CE, but unofficially it means "if it runs on the desktop and it isn't owned by any other team, it belongs to the IDE Tools team".&amp;nbsp;As a result, I get to stick my fingers in nearly every aspect of development for the desktop - compilers, debuggers,&amp;nbsp;build systems, setup, C#, C++, scripting, you name it. If it runs on a Windows NT platform (Windows 2000, XP, Vista, etc.), I'm supposed to know all about it. &lt;EM&gt;It's my job.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Platform Builder ("PB")&amp;nbsp;is the IDE for developing the CE operating system. This also takes a bit of explaining.&lt;/P&gt;
&lt;P&gt;CE is different from NT in a lot of ways. You don't go out, buy a copy of CE, and install it on your phone/PDA/router/refrigerator/toaster. You buy a phone or a PDA with CE already built into it. That copy of CE was customized and tweaked to make it a (hopefully) perfect fit for the phone or PDA onto which it was installed. Typically HP, Samsung, HTC, or some other hardware vendor will&amp;nbsp;design and&amp;nbsp;develop some hardware to meet a need, then&amp;nbsp;use&amp;nbsp;the PB tools to&amp;nbsp;tweak the CE operating system to work well with their hardware. The hardware and the CE operating system are then sold as a single item. So you won't see a copy of "Windows CE" on the shelf at your local software retailer.&lt;/P&gt;
&lt;P&gt;PB&amp;nbsp;has a catalog that allows the vendor to choose the parts of the operating system they need. A minimal CE&amp;nbsp;operating system&amp;nbsp;with just a kernel and basic device drivers is about 300K. A fully featured CE&amp;nbsp;OS with a web browser, web server, solitaire, .NET Compact Framework, media player, etc. can be 64 MB or more. Somewhere in the middle is an&amp;nbsp;OS that (hopefully) has&amp;nbsp;all of&amp;nbsp;the features you need for your device. This is important because each additional megabyte of flash or RAM adds to the cost of the hardware,&amp;nbsp;reduces battery life, and increases device size and weight. These costs&amp;nbsp;become especially significant if&amp;nbsp;plan to ship 1 million CE-based &lt;A class="" title="Talkie Toaster" href="http://en.wikipedia.org/wiki/Red_Dwarf_characters#Talkie_Toaster" target=_blank mce_href="http://en.wikipedia.org/wiki/Red_Dwarf_characters#Talkie_Toaster"&gt;talking toasters&lt;/A&gt;. (Are you sure you don't want a nice English muffin right now?)&lt;/P&gt;
&lt;P&gt;Most devices running CE are proprietary hardware designs with a unique combination of microchips designed to fill a specific niche in the market. This usually means that the CE operating system needs to be customized somewhat to run on the specific hardware. Often, device manufacturers have to write their own device drivers since they're using proprietary hardware. PB provides many tools to help with this process.&amp;nbsp;PB provides an integrated development environment (IDE)&amp;nbsp;to allow developers to edit and compile their code (driver, application, etc.), copy it to the device ("download"), run their code and control its execution (remote shell), and&amp;nbsp;debug their code (debugger).&lt;/P&gt;
&lt;P&gt;Four&amp;nbsp;different teams work on PB - debugger/connectivity, remote tools, build, and shell/project system (that's my team!). The responsibilities of the other teams are fairly self-explanatory and well-defined. The debugger/connectivity team works on the PB kernel debugger,&amp;nbsp;the KITL connectivity layer, and the platform manager/connection manager transport layers. The remote tools team works on tools that run on the desktop to provide data about&amp;nbsp;what is going on within a device (remote registry&amp;nbsp;editor, remote file viewer, kernel tracker, etc.) The build team (currently one person, recently split off from&amp;nbsp;the shell/project system team) is responsible for&amp;nbsp;improving the CE build system.&amp;nbsp;The responsibilities of my team (shell/project system) are a bit more nebulous, and we tend to&amp;nbsp;wind up&amp;nbsp;doing anything&amp;nbsp;not covered by any other team (this drives my manager nuts).&lt;/P&gt;
&lt;P&gt;The exact boundaries are sometimes hazy, but since the goal is&amp;nbsp;"get the product working well", not "make my team look good", the boundaries don't have to be rock-solid.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1858009" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dcook/archive/tags/pb/default.aspx">pb</category><category domain="http://blogs.msdn.com/dcook/archive/tags/ce/default.aspx">ce</category><category domain="http://blogs.msdn.com/dcook/archive/tags/team/default.aspx">team</category></item></channel></rss>