<?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>The Great Flying Tortoise</title><link>http://blogs.msdn.com/benkaras/default.aspx</link><description>A hard-boiled look at Win32 C++ programming and the property system</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Troubleshooting: Why isn't my property handler getting indexed?</title><link>http://blogs.msdn.com/benkaras/archive/2007/07/24/troubleshooting-why-isn-t-my-property-handler-getting-indexed.aspx</link><pubDate>Tue, 24 Jul 2007 20:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4031975</guid><dc:creator>benkaras</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/4031975.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=4031975</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=4031975</wfw:comment><description>&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Having trouble getting your property handler working with the indexer?&amp;nbsp; Here are some troubleshooting tips.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 10pt 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpFirst&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;1.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that your propdesc file(s) are in a global location&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;2.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that you registered your propdesc file(s) using absolute paths&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;3.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that the event log did not record any failures from registering your propdesc file.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;4.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that your property description is well formed, accurate, and was registered properly.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;5.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that your property descriptions are marked isColumn="true", isViewable="true", and isQueryable="true" as appropriate.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;6.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that your DLL is in a global location (e.g. not under your user profile)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;7.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that your DLL is registered under HKLM\Software\Classes&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;8.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that your DLL is registered using full paths (or REG_EXPAND_SZ strings that expand to absolute paths using environment variables known by the System account)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;9.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that your property handler works under explorer&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;10.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;We prefer that you use IInitializeWithStream.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you must use IInitializeWithFile or IInitializeWithItem, verify that you specify DisableProcessIsolation&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;11.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that the "Indexing Options" control panel lists your filetype as an indexed filetype&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;12.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that the test file is in an indexed location&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraphCxSpLast&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;13.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Verify that the test file's has been modified since after you installed your property handler&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0in" class=MsoNormal&gt;&lt;FONT face=georgia,palatino&gt;Common Mistakes:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 10pt 0in 0pt 0.5in; mso-list: l0 level1 lfo2" class=MsoListParagraphCxSpFirst&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;1.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Placing propdesc files or DLLs under a user directory&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;2.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Registering things with relative paths&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;3.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Registering things under HKCU instead of HKLM (remember that HKCR shows a merged view of the two hives)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo2" class=MsoListParagraphCxSpMiddle&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;4.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Forgetting DisableProcessIsolation for non-stream handlers&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo2" class=MsoListParagraphCxSpLast&gt;&lt;FONT face=georgia,palatino&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;5.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;The test file wasn't modified or wasn't in an indexed location&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 10pt 0in" class=MsoNormal&gt;&lt;FONT color=#000000&gt;&lt;FONT face=georgia,palatino&gt;If all else fails, you can use Image File Execution Options to attach a debugger to searchindexer.exe and child processes (On Vista, I&amp;nbsp;use "&amp;lt;pathto&amp;gt;\ntsd.exe -server tcp:port=8001,icfenable -gG -o -snul";&amp;nbsp; On Win7, I use: "&amp;lt;pathto&amp;gt;\ntsd.exe -server npipe:pipe=foo -gG -o -snul").&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Reboot, attach to the debugger, and type "sxeld mypropertyhandler".&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The debugger will break when your DLL gets loaded.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Use of debuggers is an advanced topic that I won't get into right now.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4031975" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/benkaras/archive/tags/Property+Handlers/default.aspx">Property Handlers</category><category domain="http://blogs.msdn.com/benkaras/archive/tags/indexing/default.aspx">indexing</category><category domain="http://blogs.msdn.com/benkaras/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item><item><title>Property handlers and .NET</title><link>http://blogs.msdn.com/benkaras/archive/2007/05/02/property-handlers-and-net.aspx</link><pubDate>Wed, 02 May 2007 23:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2379977</guid><dc:creator>benkaras</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/2379977.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=2379977</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=2379977</wfw:comment><description>&lt;P&gt;A reader asked:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;I've been reading up the issues with using .NET for property handlers. I know you can't using .NET Interop to create a property handler without getting into issues with the version of the .NET framework. I discovered though that .NET Assemblies can be registered and used as COM objects. Could one implement the required functions of IPropertyStore in c++ and then inside those functions make calls to a COM object that does all the real work?&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;I know you said that you feel property handlers should be written in c/c++ for performance reasons but would this get around the issue of the framework version issue?&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is a very&amp;nbsp;good question, but the answer is "probably not".&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The reason is that property handlers cannot cause .NET code to get loaded in the caller's process which is not supported.&amp;nbsp; It has nothing to do with performance.&amp;nbsp; So you cannot get around the issue by writing a C++ stub that calls a .NET COM object in the &lt;STRONG&gt;same&lt;/STRONG&gt; process.&lt;/P&gt;
&lt;P&gt;The only thing that works is to write a C++ stub that calls a .NET class running in a &lt;STRONG&gt;different&lt;/STRONG&gt; process altogether.&amp;nbsp; But that's a lot more work, introduces a lot of failure paths, may introduce subtle interactions, etc.&lt;/P&gt;
&lt;P&gt;Raymond Chen digs into the reasons with this post:&amp;nbsp; &lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;A href="http://blogs.msdn.com/1317290.aspx" mce_href="http://blogs.msdn.com/1317290.aspx"&gt;http://blogs.msdn.com/1317290.aspx&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&amp;nbsp;[Update 2007-06-04: I found another article (from 2006) which repeats this warning:&amp;nbsp; &lt;A href="http://msdn.microsoft.com/msdnmag/issues/04/01/WindowsShell/default.aspx"&gt;http://msdn.microsoft.com/msdnmag/issues/04/01/WindowsShell/default.aspx&lt;/A&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2379977" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/benkaras/archive/tags/Property+Handlers/default.aspx">Property Handlers</category><category domain="http://blogs.msdn.com/benkaras/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Property Handler Decisions and Preparation</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/29/property-handler-decisions-and-preparation.aspx</link><pubDate>Tue, 30 Jan 2007 09:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1555583</guid><dc:creator>benkaras</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1555583.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1555583</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1555583</wfw:comment><description>&lt;P&gt;Viewed as a &lt;A class="" href="http://blogs.msdn.com/benkaras/archive/2007/01/28/understanding-the-role-of-property-handlers.aspx" mce_href="http://blogs.msdn.com/benkaras/archive/2007/01/28/understanding-the-role-of-property-handlers.aspx"&gt;data flow component&lt;/A&gt;, a property handler has a single file stream input and outputs a one or more properties.&amp;nbsp; Unfortunately, writing one requires making many decisions before you even set eyes on the code.&amp;nbsp; Let's look at a few of these preparations.&lt;/P&gt;
&lt;P&gt;First, pick a file type.&amp;nbsp; You'll be writing a property handler for this file type.&lt;/P&gt;
&lt;P&gt;Now decide which properties you want to store.&amp;nbsp; Properties generally fall into a few categories.&amp;nbsp; Take a moment to consider which of the following you want to support:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;System defined properties (e.g. System.Author)&lt;/LI&gt;
&lt;LI&gt;Properties you define for your filetype (e.g. MyCompany.MyApp.MyProperty)&lt;/LI&gt;
&lt;LI&gt;Properties other people define and want to set on your file (e.g. SomeoneElse.Other.Property, aka "open metadata")&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Next, decide where in the file you'll be storing the properties.&amp;nbsp; Hopefully the file's format allows for this already.&amp;nbsp; If it doesn't, you'll have to collaborate with other users of this file format to accomodate these properties.&amp;nbsp; Here are a few storage&amp;nbsp;options:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Compute the property from other data in the file (e.g. System.Document.WordCount)&lt;/LI&gt;
&lt;LI&gt;Read the property from a specific location in the file (e.g. the EXIF header in certain image formats)&lt;/LI&gt;
&lt;LI&gt;Read the property from a dynamic storage structure (e.g. suitable for storing SomeoneElse.Other.Property)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;And let's not forget deciding which of your properties will be &lt;A href="http://msdn2.microsoft.com/en-us/library/ms630273.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms630273.aspx"&gt;viewable&lt;/A&gt;, &lt;A href="http://msdn2.microsoft.com/en-us/library/ms630282.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms630282.aspx"&gt;editable&lt;/A&gt;, &lt;A href="http://msdn2.microsoft.com/en-us/library/ms630280.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms630280.aspx"&gt;searchable&lt;/A&gt;, &lt;A href="http://msdn2.microsoft.com/en-us/library/bb267290.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb267290.aspx"&gt;etc&lt;/A&gt;.&amp;nbsp; Better start taking notes if you haven't already!&lt;/P&gt;
&lt;P&gt;Once you know where to place your properties, you get to decide how to format them in your file.&amp;nbsp; Will you turn them into strings?&amp;nbsp; Or would a binary format be better?&amp;nbsp; Maybe you'll want to store some properties directly in the file format and others into a special dumping ground for open metadata.&lt;/P&gt;
&lt;P&gt;Also quite important is choosing which API you will use to write to the file format.&amp;nbsp; Hopefully it supports stream inputs.&amp;nbsp; If it doesn't you'll have to flag your handler as "legacy".&amp;nbsp; Typically you'll end up writing a small layer mapping propert keys and values to whatever the format-specific API uses.&lt;/P&gt;
&lt;P&gt;There is one easy decision in this mix.&amp;nbsp; Choose your programming language from the following list: C++, C.&amp;nbsp; Regrettably, &lt;A href="http://blogs.msdn.com/oldnewthing/archive/2006/12/18/1317290.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2006/12/18/1317290.aspx"&gt;shell extensions cannot use the CLR&lt;/A&gt;, so you may not use C# or any other .NET language.&lt;/P&gt;
&lt;P&gt;As you can see, there are a lot of little decisions you get to make when writing a property handler.&amp;nbsp; There are undoubtedly more that I've missed, but you'll stumble upon those as you prepare your handler.&amp;nbsp; Additionally, there are many little options and flags you can use to tweak the way your property handler works and to accomplish more advanced tasks.&amp;nbsp; I am skipping those for now in favor of presenting them as a list later.&lt;/P&gt;
&lt;P&gt;-Ben Karas&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1555583" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/benkaras/archive/tags/Property+Handlers/default.aspx">Property Handlers</category></item><item><title>Understanding the Role of Property Handlers</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/28/understanding-the-role-of-property-handlers.aspx</link><pubDate>Mon, 29 Jan 2007 06:26:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1549682</guid><dc:creator>benkaras</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1549682.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1549682</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1549682</wfw:comment><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Knowing what you are trying to accomplish is the first step to using the property system.&amp;nbsp; Property handlers provide a specific set of services which&amp;nbsp;support specific behaviors in the Windows shell.&amp;nbsp; So let's delve into the role of a property handler and how it relates to other components.&lt;/p&gt; &lt;p&gt;As a data flow diagram, a property handler is pretty simple:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/UnderstandingtheRoleofPropertyHandlers_13D97/image03.png" atomicselection="true"&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/UnderstandingtheRoleofPropertyHandlers_13D97/image07.png" atomicselection="true"&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/UnderstandingtheRoleofPropertyHandlers_13D97/image011.png" atomicselection="true"&gt;&lt;img height="55" src="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/UnderstandingtheRoleofPropertyHandlers_13D97/image0_thumb5.png" width="393"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The input is a file stream.&amp;nbsp; The output is a set of properties.&amp;nbsp; Yup, that simple.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Notice that although property handlers interpret files, they don't open the files themselves.&amp;nbsp; The layer above it does!&amp;nbsp; There are good reasons for this which I'll discuss another time.&amp;nbsp; To prepare the property handler, the file system namespace creates&amp;nbsp;the file stream, creates&amp;nbsp;the property handler, and passes the stream to the property handler via the IInitializeWithStream interface.&amp;nbsp; Once the property stack is completed, the application is free to read and write properties through the stack.&amp;nbsp; If the layers above the property handler don't answer a question, they'll pass it down to the property handler.&lt;/p&gt; &lt;p&gt;It is also very important to understand what property handlers do not do.&amp;nbsp; Applying a bit of logic, we can reason out much of the role a property handler plays:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;A&amp;nbsp;single property handler gets created per file.&amp;nbsp; Thus... &lt;ul&gt; &lt;li&gt;A&amp;nbsp;property handler must be the authority on the layout of the file stream it is handed.&amp;nbsp;  &lt;li&gt;It is not possible to "augment" the set of properties on a file.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;The property handler must glean its properties from the file stream&amp;nbsp;itself.&amp;nbsp; Thus... &lt;ul&gt; &lt;li&gt;The property system, in general, cannot store properties on every file.&amp;nbsp; Not all files allow storing properties inside them.  &lt;li&gt;&lt;a href="http://blogs.msdn.com/benkaras/archive/2006/10/17/writing-properties-2-filetype-support.aspx"&gt;Not all properties can get written to all file types&lt;/a&gt;.&amp;nbsp; Bummer.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;The caller is not guaranteed to ask the property handler for properties.&amp;nbsp; This means...  &lt;ul&gt; &lt;li&gt;To be considerate, the property handler should intialize quickly, delaying heavy work until it is actually needed.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;The property handler is dealing with files.&amp;nbsp; This means...  &lt;ul&gt; &lt;li&gt;For large files, if you have control over the file layout, consider making it stream-friendly.&amp;nbsp;  &lt;ul&gt; &lt;li&gt;Reserve extra space in the property section.  &lt;li&gt;Clump things together so that the handler doesn't have to read the whole disk to piece together data.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Property handlers are an extensibility point of the file system namespace.&amp;nbsp; Thus...  &lt;ul&gt; &lt;li&gt;Other namespaces may have different extensibility mechanisms (or none at all).  &lt;li&gt;Other namespaces may be able to delegate to the file system namespace when it comes to properties.&amp;nbsp; (The search results do this)  &lt;li&gt;Other namespaces may choose to reuse the same extensibility mechanism.&amp;nbsp; (ZIP folders do this).&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Property handlers just provide values.&amp;nbsp; Thus...  &lt;ul&gt; &lt;li&gt;Although they provide the data, the windows shell controls the way it gets displayed.  &lt;li&gt;It is not directly possible to customize the way the data is visualized(1)  &lt;li&gt;When I say "property handlers" make the shell do this or that, I really mean that the shell will do "this or that" in the presense of a property handler that provides the right set of data.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Ok, so that's a big dose of reality for one post.&amp;nbsp; Despite our best wishes, property handlers are not magic.&amp;nbsp; They provide specific functionality to enable specific behaviors.&amp;nbsp; As a reminder, the upside of the role of a property handler is that it &lt;a href="http://blogs.msdn.com/benkaras/archive/2007/01/21/what-do-property-handlers-accomplish.aspx"&gt;enables the great integration with the Windows user interface&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;-Ben Karas&lt;/p&gt; &lt;p&gt;(1) Property descriptions contain hints about how to display a value (e.g. using a stars or a text box).&amp;nbsp; Property descriptions are system-wide and therefore a handler only can set the hints for properties it introduced to the system.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1549682" width="1" height="1"&gt;</description></item><item><title>Property Handler Terminology</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/24/property-handler-terminology.aspx</link><pubDate>Thu, 25 Jan 2007 09:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1526378</guid><dc:creator>benkaras</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1526378.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1526378</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1526378</wfw:comment><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;In this series, I will be presenting Windows Vista functionality with a focus on the the file system&amp;nbsp;namespace.&amp;nbsp; Feel free to ask questions, especially if you want to know how things work on XP or in other namespaces, since I'll otherwise ignore those topics for now.&lt;/p&gt; &lt;p&gt;But first, let's get some terminology out of the way.&amp;nbsp; &lt;/p&gt; &lt;p&gt;The &lt;strong&gt;Windows Shell&lt;/strong&gt; includes the Windows user interface and also reusable bits such as the save-as and folder browser dialogs.&amp;nbsp; The shell includes things like the start menu, task bar, desktop, folder views, details pane, properties dialog, and the search UI.&amp;nbsp; &lt;/p&gt; &lt;p&gt;The &lt;strong&gt;Indexer&lt;/strong&gt; is a service that gathers properties and full text from files and items and answers search queries.&lt;/p&gt; &lt;p&gt;There are also various &lt;strong&gt;other applications&lt;/strong&gt; that choose to use the property system to read or write properties to files.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/698e6f2213fb_F0CE/image%7B0%7D%5B3%5D.png" atomicselection="true"&gt;&lt;img height="158" src="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/698e6f2213fb_F0CE/image%7B0%7D_thumb%5B1%5D.png" width="492"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;All these applications connect to the property system via &lt;a href="http://blogs.msdn.com/benkaras/archive/2006/08/29/730098.aspx"&gt;IShellItem2::GetPropertyStore&lt;/a&gt;.&amp;nbsp; This API creates &lt;a href="http://blogs.msdn.com/benkaras/archive/2006/09/05/740476.aspx"&gt;a bunch of components and stacks them together&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;The top layer I'm calling the &lt;strong&gt;Coercion Layer&lt;/strong&gt;.&amp;nbsp; It's job is to ensure that values are of the correct type by weeding out bad ones, removing duplicates from vectors, and trimming spaces from strings.&lt;/p&gt; &lt;p&gt;The &lt;strong&gt;Shell Item Layer&lt;/strong&gt; provides a set of properties, including PKEY_SFGAOFlags.&amp;nbsp; The shell item layer sits atop the shell namespace extensibility point.&amp;nbsp; As I mentioned earlier, I will&amp;nbsp;focus on one in particular:&amp;nbsp;the file system namespace.&lt;/p&gt; &lt;p&gt;The &lt;strong&gt;Shell File System Namespace&lt;/strong&gt; provides properties about files such as PKEY_Size and PKEY_ItemType.&amp;nbsp; It sits atop the property handler extensibility point.&lt;/p&gt; &lt;p&gt;The &lt;strong&gt;Property Handler&lt;/strong&gt; is at the bottom of the stack and provides a set of properties derived from the contents of a file.&amp;nbsp; Property handlers exist only in the file system namespace.&lt;/p&gt; &lt;p&gt;The way to really &lt;a href="http://en.wikipedia.org/wiki/Grok"&gt;grok&lt;/a&gt; this stack is to understand that each layer wraps the one below it.&amp;nbsp; When asked for a property, any given layer chooses whether to return the value itself or to ask the layer beneath it.&amp;nbsp; The property stack is really just a chain of command.&lt;/p&gt; &lt;p&gt;-Ben Karas&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1526378" width="1" height="1"&gt;</description></item><item><title>What does a property handler accomplish?</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/21/what-do-property-handlers-accomplish.aspx</link><pubDate>Mon, 22 Jan 2007 03:53:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1505262</guid><dc:creator>benkaras</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1505262.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1505262</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1505262</wfw:comment><description>&lt;p&gt;A&amp;nbsp;property handler is the piece of code that enables you to see the properties about your files as in the picture below.&amp;nbsp; Don't worry about the ambiguity in this sentence; I will be much more specific concerning what component does what in later posts.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/WhyBuildaPropertyHandler_E155/image%7B0%7D%5B14%5D.png" atomicselection="true"&gt;&lt;img height="267" src="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/WhyBuildaPropertyHandler_E155/image%7B0%7D_thumb%5B8%5D.png" width="792"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Here I've created three .book files.&amp;nbsp; This is a file type I made up last weekend, so&amp;nbsp;clearly Windows cannot know how to figure out all the data on the screen above without help.&amp;nbsp; That is where a property handler comes in.&amp;nbsp; It knows about the properties that apply to each .book&amp;nbsp;file and helps Windows to display this information.&lt;/p&gt; &lt;p&gt;In addition to displaying properties, property handlers let users edit them within the&amp;nbsp;standard Windows user interface:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/WhyBuildaPropertyHandler_E155/image%7B0%7D%5B18%5D.png" atomicselection="true"&gt;&lt;img height="105" src="http://blogs.msdn.com/blogfiles/benkaras/WindowsLiveWriter/WhyBuildaPropertyHandler_E155/image%7B0%7D_thumb%5B10%5D.png" width="216"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Property handlers also let users search for files based on the property values.&amp;nbsp; I can search for "Haunting" and Windows will show "Blindness" in the result set.&amp;nbsp; And all this can happen from within the standard Windows user interface.&lt;/p&gt; &lt;p&gt;So, in summary,&amp;nbsp;property handlers help your file types fit better into the Windows search and organize experience.&amp;nbsp; By exposing properties directly in the Windows UI, your users can&amp;nbsp;seamlessly interact with your files without having to open them in applications all the time.&amp;nbsp; When they have property handlers, your file types feel less bolted onto Windows.&lt;/p&gt; &lt;p&gt;-Ben Karas&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1505262" width="1" height="1"&gt;</description></item><item><title>Computer Science Exams</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/18/computer-science-exams.aspx</link><pubDate>Fri, 19 Jan 2007 09:19:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1491881</guid><dc:creator>benkaras</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1491881.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1491881</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1491881</wfw:comment><description>&lt;p&gt;Graduate level courses are surreal.&amp;nbsp; Professors assign nearly impossible homework assignments and projects.&amp;nbsp;&amp;nbsp;The exams&amp;nbsp;make you&amp;nbsp;break out in&amp;nbsp;sweat just thinking about them.&amp;nbsp;&amp;nbsp;At the same time, you are often able to just sketch out solutions since it is assumed you could carry out the details if you really wanted to; weeks pass where you just hold classroom discussions instead of doing "real" work.&lt;/p&gt; &lt;p&gt;The exams in an analaysis of algorithms course I took several years ago were particularly interesting.&amp;nbsp; Consisting of only one or two questions, they asked you to perform analysis on an algorithm you had probably never seen before.&amp;nbsp; Consequently, there wasn't much you could really do to prepare for the exam.&lt;/p&gt; &lt;p&gt;This all led to a strange incident on the first exam day.&amp;nbsp; The professor, who shall remain unnamed, was handing out the exam papers at the start of class.&amp;nbsp; As he did so,&amp;nbsp;one of the students raised his hand and asked, almost seriously, &amp;nbsp;"Is this exam open book?".&lt;/p&gt; &lt;p&gt;The professor casually replied, "Um, sure, why not?"&lt;/p&gt; &lt;p&gt;:-)&lt;/p&gt; &lt;p&gt;Needless to say this didn't make the exam any easier.&amp;nbsp; Somehow, I miss those days.&lt;/p&gt; &lt;p&gt;-Ben&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1491881" width="1" height="1"&gt;</description></item><item><title>Viruwormy</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/16/viruwormy.aspx</link><pubDate>Wed, 17 Jan 2007 10:25:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1482091</guid><dc:creator>benkaras</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1482091.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1482091</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1482091</wfw:comment><description>&lt;p&gt;I can't bring myself to click the "compile" button on my property handler project yet... so here's a little piece of geeky joy:&amp;nbsp; &lt;a href="http://www76.pair.com/keithlim/jabberwocky/parodies/viruwormy.html"&gt;Viruwormy&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;-Ben Karas&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1482091" width="1" height="1"&gt;</description></item><item><title>Pandora and the Music Genome Project</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/13/pandora-and-the-music-genome-project.aspx</link><pubDate>Sun, 14 Jan 2007 03:39:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1463389</guid><dc:creator>benkaras</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1463389.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1463389</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1463389</wfw:comment><description>&lt;p&gt;A coworker recently turned me onto &lt;a href="http://pandora.com"&gt;Pandora.com&lt;/a&gt;, a new music service backed by the Music Genome Project.&amp;nbsp; The concept is to create a radio station tailored to your exact likes and dislikes.&amp;nbsp; You tell it an artist you enjoy and it decodes what makes you enjoy that style of music.&amp;nbsp; &lt;/p&gt; &lt;p&gt;What I like about this service is that it is free and has a single non-annoying, unobtrusive ad that refreshes every few seconds.&amp;nbsp; Not bad!&amp;nbsp; This is especially nice with &lt;a href="http://www.microsoft.com/windows/ie/default.mspx#ie7tabs"&gt;IE 7 tabs&lt;/a&gt;.&amp;nbsp; I can place Pandora on one tab and then continue surfing the net.&amp;nbsp; When it comes time to rate a new song, I just tab over and then tab back.&amp;nbsp;&lt;/p&gt; &lt;p&gt;-Ben Karas&lt;/p&gt; &lt;p&gt;ps.&amp;nbsp; I keep meaning to blog about how to write a property handler.&amp;nbsp; Honestly!&amp;nbsp; But I've discovered that blogging is hard if you want to talk about technical content.&amp;nbsp; Not only do I have to write a program ahead of time, but I have to research the nooks and crannies of the APIs, design a way to present it, etc.&amp;nbsp; Plus I've been working hard lately (&lt;a href="http://msdn2.microsoft.com/en-us/default.aspx"&gt;writing documentation&lt;/a&gt;, working late, &lt;a href="http://seattlepi.nwsource.com/local/299492_weather12.html"&gt;waiting for the Seattle buses to put their chains&lt;/a&gt; on, etc.).&amp;nbsp; Maybe I should just develop &lt;a href="http://dilbertblog.typepad.com/"&gt;funny opinions&lt;/a&gt; which are quicker to blog?&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1463389" width="1" height="1"&gt;</description></item><item><title>Code for Previous Blog Posts</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/09/code-for-previous-blog-posts.aspx</link><pubDate>Wed, 10 Jan 2007 08:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1442530</guid><dc:creator>benkaras</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1442530.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1442530</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1442530</wfw:comment><description>&lt;P&gt;Someone asked if I had a copy of the code I've been using in my blog so far.&amp;nbsp; Well, I didn't as of 5pm today, so I&amp;nbsp;went back and collected the code into 3 projects:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;propreader.exe &amp;lt;file&amp;gt;&lt;BR&gt;&amp;nbsp;- &lt;A href="http://blogs.msdn.com/benkaras/archive/2006/10/12/Property-coding-expedition-_2300_7-_2D00_-The-final-output.aspx" mce_href="http://blogs.msdn.com/benkaras/archive/2006/10/12/Property-coding-expedition-_2300_7-_2D00_-The-final-output.aspx"&gt;Prints a list of all properties we know about the file&lt;/A&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;propwriter.exe &amp;lt;file&amp;gt; &amp;lt;property&amp;gt; &amp;lt;value&amp;gt;&lt;BR&gt;&amp;nbsp;- &lt;A href="http://blogs.msdn.com/benkaras/archive/2006/10/16/writing-a-property-1.aspx" mce_href="http://blogs.msdn.com/benkaras/archive/2006/10/16/writing-a-property-1.aspx"&gt;Writes a single value&lt;/A&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;proplister.exe &amp;lt;file&amp;gt; &amp;lt;proplist&amp;gt;&lt;BR&gt;&amp;nbsp;- &lt;A href="http://blogs.msdn.com/benkaras/archive/2006/11/07/writing-properties-5-property-lists.aspx" mce_href="http://blogs.msdn.com/benkaras/archive/2006/11/07/writing-properties-5-property-lists.aspx"&gt;Prints all the properties included in a proplist&lt;/A&gt; (e.g. System.PropList.PreviewDetails)&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;A class="" href="http://blogs.msdn.com/benkaras/attachment/1442530.ashx" mce_href="http://blogs.msdn.com/benkaras/attachment/1442530.ashx"&gt;I've attached the code here (code.zip)&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;
&lt;P&gt;-Ben Karas&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1442530" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/benkaras/attachment/1442530.ashx" length="12482" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/benkaras/archive/tags/Property+System/default.aspx">Property System</category><category domain="http://blogs.msdn.com/benkaras/archive/tags/writing+properties/default.aspx">writing properties</category><category domain="http://blogs.msdn.com/benkaras/archive/tags/reading+properties/default.aspx">reading properties</category></item><item><title>Choosing your property API</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/05/choosing-your-property-api.aspx</link><pubDate>Fri, 05 Jan 2007 23:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1388350</guid><dc:creator>benkaras</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1388350.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1388350</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1388350</wfw:comment><description>&lt;P&gt;&lt;FONT face=georgia,palatino&gt;It is time that I talk a little about what to do if you want your application to run on XP.&amp;nbsp; There are three sets of APIs, each with subtle differences and caveats, and ultimately your choice requires deciding what platform your application must run on:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=georgia,palatino&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;&lt;STRONG&gt;Windows Vista:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Call &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms632794.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms632794.aspx"&gt;&lt;FONT face="courier new,courier"&gt;IShellItem2&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="courier new,courier"&gt;::&lt;/FONT&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms632784.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms632784.aspx"&gt;&lt;FONT face="courier new,courier"&gt;GetPropertyStore&lt;/FONT&gt;&lt;/A&gt; to get an &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms633762.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms633762.aspx"&gt;&lt;FONT face="courier new,courier"&gt;IPropertyStore&lt;/FONT&gt;&lt;/A&gt; interface.&amp;nbsp;&amp;nbsp; The output property store includes property handler properties (e.g. Photo dimensions) and i&lt;/FONT&gt;&lt;FONT face=Georgia&gt;nnate properties (e.g. Size, Name).&amp;nbsp; This is your one-stop-shop for properties.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Caveat: This technique only works on Vista and later OSes.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;&lt;STRONG&gt;Windows XP with Windows Desktop Search 3.x:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;You can pass an &lt;A class="" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/IShellItem/IShellItem.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/IShellItem/IShellItem.asp"&gt;&lt;FONT face="courier new,courier"&gt;IShellItem&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;interface to &lt;/FONT&gt;&lt;A class="" href="http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/psgetitempropertyhandler.asp" mce_href="http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/psgetitempropertyhandler.asp"&gt;&lt;FONT face="courier new,courier"&gt;PSGetItemPropertyHandler&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt;&amp;nbsp;to get an &lt;FONT face="courier new,courier"&gt;&lt;A class="" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/ipropertystore/ipropertystore.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/ipropertystore/ipropertystore.asp"&gt;IPropertyStore&lt;/A&gt;&lt;/FONT&gt; interface.&amp;nbsp; Much of the property system works with Windows Desktop Search 3.x, so you can ask for property descriptions and everything.&amp;nbsp; One upshot is that this API works identically on Vista so if you are able to choose to use it, you don't have to detect versions or anything.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Georgia&gt;Unfortunately, innate properties are only available through methods on &lt;FONT face="Courier New"&gt;IShellFolder&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;IShellFolder2&lt;/FONT&gt;.&amp;nbsp; So you're on your own for those.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Caveat: Properties written to this API may or may not readable on Vista. [Aside: The full story is more complicated, but I'd like to move on for now]&amp;nbsp; Innate properties like &lt;FONT face="courier new,courier"&gt;PKEY_Size &lt;/FONT&gt;&lt;FONT face=georgia,palatino&gt;are not exposed&lt;/FONT&gt;.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Windows XP; Windows XP with Windows Desktop Search 2.x:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Properties on XP are exposed through &lt;A class="" href="http://msdn2.microsoft.com/en-gb/library/aa379840.aspx" mce_href="http://msdn2.microsoft.com/en-gb/library/aa379840.aspx"&gt;&lt;FONT face="courier new,courier"&gt;IPropertySetStorage&lt;/FONT&gt;&lt;/A&gt;.&amp;nbsp; The supported technique is to call &lt;A class="" href="http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ifaces/ishellfolder/ishellfolder.asp" mce_href="http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ifaces/ishellfolder/ishellfolder.asp"&gt;&lt;FONT face="courier new,courier"&gt;IShellFolder&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="courier new,courier"&gt;::&lt;/FONT&gt;&lt;A class="" href="http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ifaces/ishellfolder/bindtostorage.asp" mce_href="http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ifaces/ishellfolder/bindtostorage.asp"&gt;&lt;FONT face="courier new,courier"&gt;BindToStorage&lt;/FONT&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;(&lt;/FONT&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-gb/library/aa379840.aspx" mce_href="http://msdn2.microsoft.com/en-gb/library/aa379840.aspx"&gt;&lt;FONT face="courier new,courier"&gt;IPropertySetStorage&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt; for the item.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Georgia&gt;Innate properties such as size and name are exposed through various methods on &lt;FONT face="courier new,courier"&gt;IShellFolder&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;IShellFolder2&lt;/FONT&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Caveats: Properties written with this API may or may not be readable on Vista.&amp;nbsp; Furthermore, on Vista, this technique only works for some namespaces and not others.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Georgia&gt;Gotcha:&amp;nbsp; Many people mistakenly call &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/aa380342.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa380342.aspx"&gt;&lt;FONT face="courier new,courier"&gt;StgOpenStorageEx&lt;/FONT&gt;&lt;/A&gt;.&amp;nbsp; Don't do that!&amp;nbsp; &lt;FONT face="courier new,courier"&gt;StgOpenStorageEx&lt;/FONT&gt; is &lt;EM&gt;only&lt;/EM&gt; supported for specific formats like&amp;nbsp;OLE Compound Documents or NTFS secondary stream storage.&amp;nbsp; &lt;FONT face="courier new,courier"&gt;StgOpenStorageEx&lt;/FONT&gt; doesn't know how to read the EXIF header from a .JPG image.&amp;nbsp; &lt;FONT face="courier new,courier"&gt;IShellFolder::BindToStorage&lt;/FONT&gt; knows how to do such things. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;&lt;STRONG&gt;Best of&amp;nbsp;all worlds:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;If you really enjoy coding, you can detect if&amp;nbsp;a given API is present&amp;nbsp;by calling GetProcAddress or QueryInterface [Aside: please don't detect versions... just&amp;nbsp;directly test if the API is present or not], select the best available&amp;nbsp;API,&amp;nbsp;and deliver an application that works better on Vista.&amp;nbsp; &lt;SPAN lang=EN style="FONT-FAMILY: 'Georgia','serif'; mso-ansi-language: EN"&gt;Hey, "Works better on Vista" sounds like a marketing slogan --&amp;nbsp;you could have fun coding and sell more software too!&lt;/SPAN&gt;&lt;SPAN lang=EN style="mso-ansi-language: EN"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;-Ben Karas&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1388350" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/benkaras/archive/tags/Property+System/default.aspx">Property System</category></item><item><title>The fickle critic</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/03/the-fickle-critic.aspx</link><pubDate>Wed, 03 Jan 2007 23:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1388052</guid><dc:creator>benkaras</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1388052.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1388052</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1388052</wfw:comment><description>&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Personally, I have trouble using the "I liked it" scale ala Netflix.&amp;nbsp; A movie that garners 5 stars one week only finds 4 another week.&amp;nbsp; In a way, this arises from ambiguity present even within the "I liked it" scale.&amp;nbsp; Did I like it because I was in the mood for a happy film?&amp;nbsp; Or it an enjoyable serious film?&amp;nbsp; Would I like to see it again?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;What this scale needs are actions that go along with each rating:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;&lt;IMG title=5-stars style="WIDTH: 119px; HEIGHT: 17px" height=17 alt=5-stars src="http://blogs.msdn.com/photos/benkaras/images/original/5stars.aspx" width=119 mce_src="http://blogs.msdn.com/photos/benkaras/images/original/5stars.aspx"&gt;&amp;nbsp;- Loved it!&amp;nbsp; I watch it every weekend instead of sleeping.&amp;nbsp; I press my friends to come over and see it too.&amp;nbsp; I have an imaginary&amp;nbsp;copy of this DVD on my&amp;nbsp;bookshelf.&amp;nbsp; e.g. &lt;/FONT&gt;&lt;A class="" href="http://imdb.com/title/tt0047478/" mce_href="http://imdb.com/title/tt0047478/"&gt;&lt;FONT face=georgia,palatino&gt;Seven Samurai&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt;&amp;nbsp;or &lt;/FONT&gt;&lt;A class="" href="http://imdb.com/title/tt0100519/" mce_href="http://imdb.com/title/tt0100519/"&gt;&lt;FONT face=georgia,palatino&gt;Rosencrantz and Guildenstern are Dead&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;&amp;nbsp;&lt;IMG title=4-stars style="WIDTH: 119px; HEIGHT: 17px" height=17 alt=4-stars src="http://blogs.msdn.com/photos/benkaras/images/1387558/original.aspx" width=119 mce_src="http://blogs.msdn.com/photos/benkaras/images/1387558/original.aspx"&gt;&amp;nbsp;- Liked it a lot.&amp;nbsp; I suggest the movie to friends.&amp;nbsp; I watch it occasionally when I'm in the mood, or not.&amp;nbsp; e.g. &lt;/FONT&gt;&lt;A class="" href="http://imdb.com/title/tt0468565/" mce_href="http://imdb.com/title/tt0468565/"&gt;&lt;FONT face=georgia,palatino&gt;Tsotsi&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;&lt;IMG title=3-stars style="WIDTH: 119px; HEIGHT: 17px" height=17 alt=3-stars src="http://blogs.msdn.com/photos/benkaras/images/1387560/original.aspx" width=119 mce_src="http://blogs.msdn.com/photos/benkaras/images/1387560/original.aspx"&gt;&amp;nbsp;- Worth renting.&amp;nbsp; I watch this one if my friends invite me over.&amp;nbsp; I find myself forced to rent it just once to see what it was all about, and often find it superficially satisfying.&amp;nbsp; e.g. &lt;/FONT&gt;&lt;A class="" href="http://imdb.com/title/tt0112573/" mce_href="http://imdb.com/title/tt0112573/"&gt;&lt;FONT face=georgia,palatino&gt;Braveheart&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;&lt;IMG title=2-stars style="WIDTH: 119px; HEIGHT: 17px" height=17 alt=2-stars src="http://blogs.msdn.com/photos/benkaras/images/1387561/original.aspx" width=119 mce_src="http://blogs.msdn.com/photos/benkaras/images/1387561/original.aspx"&gt;&amp;nbsp;- Blasé.&amp;nbsp; I didn't finish the movie.&amp;nbsp; These movies evoke nothing from me and I found it boring.&amp;nbsp; I would rather go watch a car wash.&amp;nbsp; I guide my friends away from these.&amp;nbsp; e.g. &lt;/FONT&gt;&lt;A class="" href="http://imdb.com/title/tt0308644/" mce_href="http://imdb.com/title/tt0308644/"&gt;&lt;FONT face=georgia,palatino&gt;Finding Neverland&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;&lt;IMG title=1-star style="WIDTH: 119px; HEIGHT: 17px" height=17 alt=1-star src="http://blogs.msdn.com/photos/benkaras/images/1387563/original.aspx" width=119 mce_src="http://blogs.msdn.com/photos/benkaras/images/1387563/original.aspx"&gt;&amp;nbsp;- Yech.&amp;nbsp; I have a physical hatred of this movie.&amp;nbsp; This is usually a personal dislike of an otherwise popular movie.&amp;nbsp; But I will not see this again even if friends are renting it.&amp;nbsp; e.g. &lt;/FONT&gt;&lt;A class="" href="http://imdb.com/title/tt0333766/" mce_href="http://imdb.com/title/tt0333766/"&gt;&lt;FONT face=georgia,palatino&gt;Garden State&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;&lt;IMG title=0-stars style="WIDTH: 119px; HEIGHT: 17px" height=17 alt=0-stars src="http://blogs.msdn.com/photos/benkaras/images/1387564/original.aspx" width=119 mce_src="http://blogs.msdn.com/photos/benkaras/images/1387564/original.aspx"&gt;&amp;nbsp;- Why?&amp;nbsp; I don't want to see this one.&amp;nbsp; Just not my style.&amp;nbsp; e.g. &lt;/FONT&gt;&lt;A class="" href="http://imdb.com/title/tt0389860/" mce_href="http://imdb.com/title/tt0389860/"&gt;&lt;FONT face=georgia,palatino&gt;Click&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;You will probably point out that Garden State, Click, and Finding Neverland were all blockbuster movies.&amp;nbsp; I'm not saying they were bad.&amp;nbsp; I just want to make a statement about how I relate to them.&amp;nbsp; Again, ratings have multiple interpretations, which is a perennial frustration of mine.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;How do you interpret your ratings?&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1388052" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/benkaras/archive/tags/Tagging/default.aspx">Tagging</category></item><item><title>The split personality critic</title><link>http://blogs.msdn.com/benkaras/archive/2007/01/01/Split-personality-critic.aspx</link><pubDate>Mon, 01 Jan 2007 23:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1387612</guid><dc:creator>benkaras</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1387612.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1387612</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1387612</wfw:comment><description>&lt;P&gt;&lt;FONT face=georgia,palatino&gt;The 5 star rating control is misused in most applications today.&amp;nbsp; How can I say that?&amp;nbsp; What's more natural than selecting 5 stars for a movie or song?&amp;nbsp; Actually, the intuitive nature of the rating star control is the cause of this subtle usability issue.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Ratings have multiple interpretations.&amp;nbsp; Does 5 stars mean I loved a movie?&amp;nbsp; Does it mean I would recommend it to my friends?&amp;nbsp; Does it mean Netflix should send more movies like that one?&amp;nbsp; Does it mean the cinematography/main actor/director alone was worth watching?&amp;nbsp; Does it mean I would watch the movie if I'm sad/happy/with friends?&amp;nbsp; 5 stars cannot imply all these things.&amp;nbsp; And therein lies the trouble.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Intuitively, a 5-star control uses the "Liked it" scale.&amp;nbsp; I expect most people treat it this way:&amp;nbsp; 5 stars means I loved a movie.&amp;nbsp; 1 star means I hated it.&amp;nbsp; This, at least, works.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Meanwhile,&amp;nbsp;software interprets these numbers.&amp;nbsp; Netflix&amp;nbsp;tries to send me movies that resemble other 5-star movies.&amp;nbsp;&amp;nbsp;iTunes tries to play 5-star songs more often than 3-star songs.&amp;nbsp; The act of imposing this&amp;nbsp;correlation introduces a tension into my decision.&amp;nbsp; If I rate this movie as 5-stars, I now know that I'll get a bunch more like it, even if I didn't really want them.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;An example helps:&amp;nbsp; Braveheart is not a 5 star movie in my book.&amp;nbsp; Yet I want to see more movies of that caliber.&amp;nbsp; So should I give it the 3-stars on the "I liked it" scale, or the 5-stars on the "Send me more" scale?&amp;nbsp; I liked &lt;/FONT&gt;&lt;A class="" href="http://imdb.com/title/tt0443453/" mce_href="http://imdb.com/title/tt0443453/"&gt;&lt;FONT face=georgia,palatino&gt;Borat&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt;, but I usually hate that genre of movie.&amp;nbsp; So I could give that movie&amp;nbsp;4 stars or&amp;nbsp;2 stars depending on the interpretation.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;What is the proper way to incorporate a ratings system into an application if the end-user interpretation may differ from how the application makes use of the rating?&amp;nbsp; I don't have&amp;nbsp;a good answer other than to suggest that applications, including Netflix, should think very hard about how to incorporate the ratings system into their interface.&amp;nbsp; There is a balance to strike between simplicity in design and accomplishment and with complexity and nuanced meaning.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1387612" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/benkaras/archive/tags/Tagging/default.aspx">Tagging</category></item><item><title>Ben on vacation</title><link>http://blogs.msdn.com/benkaras/archive/2006/11/21/ben-on-vacation.aspx</link><pubDate>Tue, 21 Nov 2006 23:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1113132</guid><dc:creator>benkaras</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1113132.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1113132</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1113132</wfw:comment><description>&lt;P&gt;&lt;FONT face=georgia,palatino&gt;I will be on vacation until mid-December, so it is unlikely that I will make any more posts until then, or even maybe January.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;&amp;nbsp;-Ben Karas&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1113132" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/benkaras/archive/tags/General/default.aspx">General</category></item><item><title>Writing properties #9 - Summary</title><link>http://blogs.msdn.com/benkaras/archive/2006/11/21/writing-properties-9-summary.aspx</link><pubDate>Tue, 21 Nov 2006 23:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1113128</guid><dc:creator>benkaras</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/benkaras/comments/1113128.aspx</comments><wfw:commentRss>http://blogs.msdn.com/benkaras/commentrss.aspx?PostID=1113128</wfw:commentRss><wfw:comment>http://blogs.msdn.com/benkaras/rsscomments.aspx?PostID=1113128</wfw:comment><description>&lt;P&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl06_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/10/02/Coding-to-the-Windows-SDK.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Coding to the Windows SDK&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt;&amp;nbsp;&lt;BR&gt;&lt;/FONT&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl13_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/10/12/Property-coding-expedition-_2300_7-_2D00_-The-final-output.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Reading&amp;nbsp;properties&amp;nbsp;#7 - Summary&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl11_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/10/16/writing-a-property-1.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Writing properties #1 - Simple beginnings&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl10_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/10/17/writing-properties-2-filetype-support.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Writing properties #2 - Filetype support?&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl09_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/10/19/writing-properties-3-which-properties-are-writable.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Writing properties #3 - Which properties are writable?&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl07_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/11/06/writing-properties-4-which-properties-are-writeable.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Writing properties #4 - Which properties are writable?&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl06_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/11/07/writing-properties-5-property-lists.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Writing properties #5 - Property lists&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl04_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/11/09/writing-properties-6-gps-readwrite-omits-read-only-data-sources.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Writing properties #6 - GPS_READWRITE omits read-only data sources&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl02_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/11/14/the-deal-with-ipropertystorecapabilities.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;The deal with IPropertyStoreCapabilities&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl01_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/11/15/writing-properties-7-canonical-values.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Writing properties #8 - Canonical Values&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;A id=bp___v___r___postlist___EntryItems_ctl12_PostTitle href="http://blogs.msdn.com/benkaras/archive/2006/10/13/gotcha-you-must-release-property-stores-quickly.aspx"&gt;&lt;FONT face=georgia,palatino color=#0000cc&gt;Gotcha: You must release property stores quickly&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=georgia,palatino&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;----&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Writing properties is very simple at the core: you just call SetValue() and then Commit().&amp;nbsp; But then there are a bunch of details surrounding this task that make it a little more complicated.&amp;nbsp; To close this topic, I want to give one more tip:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;The best way to determine if the file/filesystem/filetype itself is writable is to simply call IShellItem2::GetPropertyStore(GPS_READWRITE).&amp;nbsp; This performs the necessary ACL checks, attribute checks, etc.&amp;nbsp;&amp;nbsp;The only downside is that the return value is non-actionable.&amp;nbsp; If you want to display a more specifical error message or offer corrective options, you'll have to program those yourself.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Thus, a property editing user interface will typically do the following:&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Test writability by opening the file with GPS_READWRITE and then release that interface&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Reopen the file with GPS_DEFAULT&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Use a property list to populate the UI&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Test writability using IPropertyDescription::GetTypeFlags&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Test writability using IPropertyStoreCapabilities::IsPropertyWritable&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Release the read-only property store&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;Then to save changes, it...&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Opens the file with GPS_READWRITE&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Calls IPropertyStore::SetValue for each change&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Calls IPropertyStore::Commit to save the changes&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=georgia,palatino&gt;Releases the read-write store&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;-Ben Karas&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=georgia,palatino&gt;ps. There is an even simpler way to write properties using IFileOperation. I'll have to revisit that another time.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1113128" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/benkaras/archive/tags/Property+System/default.aspx">Property System</category><category domain="http://blogs.msdn.com/benkaras/archive/tags/writing+properties/default.aspx">writing properties</category></item></channel></rss>