<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://codegator.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>Martin Cook - All Comments</title><link>http://codegator.com/mcook/default.aspx</link><description>Yet another C# developer with a blog.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>re: Extracting thumbnails using the Windows shell.</title><link>http://codegator.com/mcook/archive/2007/06/10/extracting-thumbnails-using-the-windows-shell.aspx#310</link><pubDate>Mon, 18 Aug 2008 12:35:39 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:310</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Hello C,&lt;/p&gt;
&lt;p&gt;Sorry I haven't responded, I simply haven't had much time for CODEGATOR lately.&lt;/p&gt;
&lt;p&gt;The thumbnail code hasn't been tested under Vista. I believe some of the interfaces may not work the same in that OS. I don't have access to Vista so I haven't been able to verify that.&lt;/p&gt;
&lt;p&gt;The code should generate thumbnails for older Office docs, but then again it's really just deferring to Office, via the Windows shell, to actually generate those images, so if it doesn't work the problem may not be in my code (I know, I know, it sounds like an excuse on my part. I'm just thinking aloud). I have not tested this code with different versions of Office.&lt;/p&gt;
&lt;p&gt;If I get the time to rediscover my website I'll look into that problem and see what I can do. &lt;/p&gt;
&lt;p&gt;Thanks for reading CODEGATOR&lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=310" width="1" height="1"&gt;</description></item><item><title>re: Extracting thumbnails using the Windows shell.</title><link>http://codegator.com/mcook/archive/2007/06/10/extracting-thumbnails-using-the-windows-shell.aspx#309</link><pubDate>Fri, 15 Aug 2008 22:27:59 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:309</guid><dc:creator>c</dc:creator><description>&lt;p&gt;With reference to my above comment, the OS that I am running on is Vista&lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=309" width="1" height="1"&gt;</description></item><item><title>re: Extracting thumbnails using the Windows shell.</title><link>http://codegator.com/mcook/archive/2007/06/10/extracting-thumbnails-using-the-windows-shell.aspx#308</link><pubDate>Fri, 15 Aug 2008 22:15:24 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:308</guid><dc:creator>C</dc:creator><description>&lt;p&gt;Hi Martin, &lt;/p&gt;
&lt;p&gt;Great article! I have a question....will it generate thumbnails for older office documents? when I am tryign to generate thumbnails for older office documents, it is throwing &amp;quot;Specified cast is not valid&amp;quot; error. So I was just wondering if you tested with older versions.&lt;/p&gt;
&lt;p&gt;It is generating thumbnails fine for 2007 office documents but only for those documents which have been saved with &amp;quot;Save Thumbnail&amp;quot; option. Is that right? Or will it generate the thumbnails on-the-fly for those documents which have not been saved with thumbnail?&lt;/p&gt;
&lt;p&gt;Did you try on a windows server 2003 box?&lt;/p&gt;
&lt;p&gt;Thanks for all your clarifications!&lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=308" width="1" height="1"&gt;</description></item><item><title>re: Extracting thumbnails using the Windows shell.</title><link>http://codegator.com/mcook/archive/2007/06/10/extracting-thumbnails-using-the-windows-shell.aspx#307</link><pubDate>Fri, 15 Aug 2008 22:11:48 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:307</guid><dc:creator>c</dc:creator><description>&lt;p&gt;c&lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=307" width="1" height="1"&gt;</description></item><item><title>re: An event broker solution - part 5</title><link>http://codegator.com/mcook/archive/2007/10/25/an-event-broker-solution-part-5.aspx#306</link><pubDate>Fri, 18 Jul 2008 17:05:54 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:306</guid><dc:creator>Steve</dc:creator><description>&lt;p&gt;How are you invoking the registration of the Handlers (Subscribers).&lt;/p&gt;
&lt;p&gt;Since you are using the [EventSubscription(&amp;quot;someMethodSignature&amp;quot;)] attribute I assume they are automatically registered, but what is invoking your auto-registration method to start?&lt;/p&gt;
&lt;p&gt;You could use a static constructor in your EventBroker to initiate this, but are you searching all classes with static methods for your attributes to initialize their registration?&lt;/p&gt;
&lt;p&gt;I see the point of useing Attribute.Topic as a rough event signature, but this also means that you need to mark every event that is supported by the EventBroker. &amp;nbsp;Couldn't you also define it through the type and its event name. &amp;nbsp;IE&lt;/p&gt;
&lt;p&gt;public class DemoListener&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;[EventSubscription&amp;lt;OtherType&amp;gt;(&amp;quot;SomeMethod&amp;quot;)] &lt;/p&gt;
&lt;p&gt; &amp;nbsp;public static OtherType_OnSomeMethod(object sender, EventArgs e)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;...&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;public class OtherType&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; public event EventHandle SomeMethod;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; public void OnSomeMethod&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(SomeMethod != null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SomeMethod(this, EventArgs.Empty);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;But again, what is registering the DemoListener.OtherType_OnSomeMethod as the listener if both OtherType and the EventBroker are loosly coupled.&lt;/p&gt;
&lt;p&gt;I had created an attribute that would auto invoke methods when the assembly loaded, but it required to be initialized by the application. &amp;nbsp;The EventSubscriptionAttribute is the better approach, but do you have to manually invoke the registration for their Registration.&lt;/p&gt;
&lt;p&gt;[AssemblyInit]&lt;/p&gt;
&lt;p&gt;public static void RunMe()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;/// I did a manuall registation here for my EventListeners&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=306" width="1" height="1"&gt;</description></item><item><title>re: Embedding adsense units inside CS 2007 blog posts</title><link>http://codegator.com/mcook/archive/2007/07/12/embedding-adsense-units-inside-cs-2007-blog-posts.aspx#305</link><pubDate>Thu, 12 Jun 2008 12:32:41 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:305</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Hello lowster,&lt;/p&gt;
&lt;p&gt;You are most welcome. I'm glad to be of assistance. Thank you for reading my little blog.&lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=305" width="1" height="1"&gt;</description></item><item><title>re: Embedding adsense units inside CS 2007 blog posts</title><link>http://codegator.com/mcook/archive/2007/07/12/embedding-adsense-units-inside-cs-2007-blog-posts.aspx#304</link><pubDate>Thu, 12 Jun 2008 02:29:29 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:304</guid><dc:creator>lowster</dc:creator><description>&lt;p&gt;I know this is an old post, but thanks so much!!&lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=304" width="1" height="1"&gt;</description></item><item><title>re: A managed wrapper for the Windows Shell PIDL structure</title><link>http://codegator.com/mcook/archive/2007/08/20/a-managed-wrapper-for-the-windows-shell-pidl-structure.aspx#302</link><pubDate>Thu, 22 May 2008 12:28:32 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:302</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Thanks for sharing your solution Erik! :o)&lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=302" width="1" height="1"&gt;</description></item><item><title>re: A managed wrapper for the Windows Shell PIDL structure</title><link>http://codegator.com/mcook/archive/2007/08/20/a-managed-wrapper-for-the-windows-shell-pidl-structure.aspx#301</link><pubDate>Tue, 20 May 2008 11:53:39 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:301</guid><dc:creator>Erik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;If anyone having the same trouble, I have solved this issue -not so perfect- with the help of regular expressions with this pattern: pattern = @&amp;quot;(http|https|ftp|file)://[a-zA-Z0-9.\-/ ]*\.[a-zA-Z]{3,4}\x00&amp;quot;;&lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=301" width="1" height="1"&gt;</description></item><item><title>re: A managed wrapper for the Windows Shell PIDL structure</title><link>http://codegator.com/mcook/archive/2007/08/20/a-managed-wrapper-for-the-windows-shell-pidl-structure.aspx#300</link><pubDate>Mon, 19 May 2008 12:45:43 GMT</pubDate><guid isPermaLink="false">60ee2e05-c1d4-40f6-b847-9c08813e2f9a:300</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Helo Erik,&lt;/p&gt;
&lt;p&gt;As you say, SHGetPathFromIDList will only return a path for a physical object (has to be part of the file system). I don't know of any magic to get around that fact. I personally wouldn't pursue a solution based on the internals of a serialized pidl. The exact structure of a pidl is subject to change by MS at any moment. Also, I think you might get different pidls based on whether the physical object is a shortcurt or contains a hardlink. Finally, beware of differences in Vista. I'm getting quite a bit of feedback from CODEGATOR readers about broken COM interfaces &amp;amp; methods in the new OS. :o(&lt;/p&gt;
&lt;p&gt;If I think of a solution to your problem I'll post it here for everyone to see. Good luck. &lt;/p&gt;
&lt;img src="http://codegator.com/aggbug.aspx?PostID=300" width="1" height="1"&gt;</description></item></channel></rss>