<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">ShawnVN&amp;#39;s Blog</title><subtitle type="html">Programming for the Windows Tablet Foundation</subtitle><id>http://weblogs.asp.net/savanness/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/savanness/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2003-04-15T19:53:00Z</updated><entry><title>ColorComb: Yet Another Color-Picker Dialog for WPF</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2006/12/05/colorcomb-yet-another-color-picker-dialog-for-wpf.aspx" /><id>http://weblogs.asp.net/savanness/archive/2006/12/05/colorcomb-yet-another-color-picker-dialog-for-wpf.aspx</id><published>2006-12-05T08:08:00Z</published><updated>2006-12-05T08:08:00Z</updated><content type="html">WPF v1 doesn't include a color-picker dialog (or a font dialog).  A variety of SDK samples and community samples will undoubtedly fill this void.  That's ok with me -- I've never been happy with the traditional Windows color-picker UI, anyway.  I can never find the color I have in mind, looking at this flattened-out-color-wheel-with-dingy-grey-bottom......(&lt;a href="http://weblogs.asp.net/savanness/archive/2006/12/05/colorcomb-yet-another-color-picker-dialog-for-wpf.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1128174" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>AutoClaimsFX</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2006/05/31/AutoClaimsFX.aspx" /><id>http://weblogs.asp.net/savanness/archive/2006/05/31/AutoClaimsFX.aspx</id><published>2006-05-31T11:07:00Z</published><updated>2006-05-31T11:07:00Z</updated><content type="html">&lt;P&gt;In celebration of &lt;A href="http://www.sellsbrothers.com/news/showTopic.aspx?ixTopic=1993"&gt;WinFX Beta2&lt;/A&gt;, I've attempted to recreate the &lt;A href="http://msdn.microsoft.com/library/en-us/tpcsdk10/lonestar/managed_ovw/tbconctlsampautoclaimform.asp"&gt;Tablet PC SDK's beloved AutoClaims sample&lt;/A&gt; in WPF.&lt;/P&gt;
&lt;P&gt;This sample demonstrates:&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://windowssdk.msdn.microsoft.com/library/en-us/cpref29/html/T_System_Windows_Controls_InkCanvas.asp"&gt;InkCanvas&lt;/A&gt; 
&lt;UL&gt;
&lt;LI&gt;collecting ink in multiple transparent layers, over an Image resource 
&lt;LI&gt;databinding for &lt;A href="http://windowssdk.msdn.microsoft.com/library/en-us/cpref29/html/P_System_Windows_Controls_InkCanvas_Strokes.asp"&gt;Strokes&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://windowssdk.msdn.microsoft.com/library/en-us/cpref29/html/P_System_Windows_Controls_InkCanvas_DefaultDrawingAttributes.asp"&gt;DefaultDrawingAttributes&lt;/A&gt; defined in static resources 
&lt;LI&gt;animated Opacity and ZIndex properties for smooth transitions among layers &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;TextBox.&lt;A href="http://windowssdk.msdn.microsoft.com/library/en-us/cpref28/html/P_System_Windows_FrameworkElement_InputScope.asp"&gt;InputScope&lt;/A&gt; 
&lt;UL&gt;
&lt;LI&gt;defines a pattern to coerce Tablet Input Panel handwriting recognition for the Year (YYYY) field &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;Scrolling and resizing 
&lt;UL&gt;
&lt;LI&gt;relative layout techniques 
&lt;LI&gt;ScrollViewer around the Image and InkCanvas elements &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;...all in 100% pure XAML!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.windojitsu.com/blog/autoclaimsfx.html"&gt;http://www.windojitsu.com/blog/autoclaimsfx.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Ok, admittedly it probably would've been easier to code some of those lengthy EventTriggers for managing the layers in C#.&amp;nbsp; And I'm a little bummed to discover than I can't set Panel.ZIndex in partial trust (else you'd be running this app in your browser right now, not reading about it).&lt;/P&gt;
&lt;P&gt;Still, it's a fun exercise in what can be done with InkCanvas and XAML, with so few lines of code compared to our WinForms platform.&amp;nbsp; You really have to compile and run the mundane old WinForms version, and peruse the code, to appreciate this WPF rendition.&lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=449777" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>ScrollViewer for Lefties</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2006/03/09/439904.aspx" /><id>http://weblogs.asp.net/savanness/archive/2006/03/09/439904.aspx</id><published>2006-03-09T08:09:00Z</published><updated>2006-03-09T08:09:00Z</updated><content type="html">&lt;p&gt;Josh says &lt;a href="http://josheinstein.com/journal/archive/2006/03/08/1319.aspx"&gt;“Windows Presentation Foundation (aka WPF, aka Avalon) is the best thing to happen to Tablet PC's.”&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Josh, I couldn't have said that better...&amp;nbsp; well done!&amp;nbsp; (We're trying hard to live up to your expectations, anyway. :-)&lt;/p&gt; &lt;p&gt;This reminds me -- at a recent talk, I happened to mention (to a group of Tablet PC developers) how ScrollViewer could be re-styled to align the scrollbar on the left, for left-handed users.&amp;nbsp; The response was quite enthusiastic!&amp;nbsp; Here's the XAML...&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.windojitsu.com/blog/leftiescrollviewer.html"&gt;http://www.windojitsu.com/blog/leftiescrollviewer.html&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=439904" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>WinFX Ink: Fun with VisualBrush</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2006/02/02/437248.aspx" /><id>http://weblogs.asp.net/savanness/archive/2006/02/02/437248.aspx</id><published>2006-02-03T07:51:00Z</published><updated>2006-02-03T07:51:00Z</updated><content type="html">Just in case anybody who reads this doesn't read Petzold... http://www.windojitsu.com/blog/inkcanvasvsvisualbrush.html &lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=437248" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>WinFX Nov CTP: Fun with InkCanvas</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2005/11/21/431142.aspx" /><id>http://weblogs.asp.net/savanness/archive/2005/11/21/431142.aspx</id><published>2005-11-22T06:09:00Z</published><updated>2005-11-22T06:09:00Z</updated><content type="html">&lt;p&gt;Here's &lt;a href="http://www.windojitsu.com/tictactoefx/tictactoefx.application"&gt;a fun little InkCanvas sample app&lt;/a&gt;, in celebration of &lt;a href="http://blogs.msdn.com/tims/archive/2005/11/18/494526.aspx"&gt;the Nov CTP release&lt;/a&gt; of WinFX... yeah that's right, it's tic-tac-toe.&amp;nbsp; What?&amp;nbsp; This ain't rocket science.&amp;nbsp; (It does, however, include &lt;a href="http://www.windojitsu.com/blog/TicTacToeFX.zip"&gt;source code&lt;/a&gt; for a very, very simple handwriting recognition engine. :-)&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.windojitsu.com/blog/tictactoefx.html"&gt;http://www.windojitsu.com/blog/tictactoefx.html&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Here's the URL to launch the game: &lt;a href="http://www.windojitsu.com/tictactoefx/tictactoefx.application"&gt;http://www.windojitsu.com/tictactoefx/tictactoefx.application&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=431142" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>New Tablet PC Team Blog Online!</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2005/08/05/421663.aspx" /><id>http://weblogs.asp.net/savanness/archive/2005/08/05/421663.aspx</id><published>2005-08-05T07:33:00Z</published><updated>2005-08-05T07:33:00Z</updated><content type="html">&lt;p&gt;New &lt;a href="http://blogs.technet.com/tabletpc/"&gt;Tablet PC Team blog&lt;/a&gt; is up on blogs.technet.com...&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.windojitsu.com/blog/tabletblogs.html"&gt;http://www.windojitsu.com/blog/tabletblogs.html&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=421663" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>Physics Illustrator Hints</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2005/05/22/408286.aspx" /><id>http://weblogs.asp.net/savanness/archive/2005/05/22/408286.aspx</id><published>2005-05-22T22:41:00Z</published><updated>2005-05-22T22:41:00Z</updated><content type="html">&lt;p&gt;I've never really blogged much about &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=56347faf-a639-4f3b-9b87-1487fd4b5a53&amp;amp;displaylang=en"&gt;Physics Illustrator&lt;/a&gt; -- the little animated shape-reco funlet for Tablet PC, inspired by &lt;a href="http://rationale.csail.mit.edu/project_assist.shtml"&gt;research from MIT&lt;/a&gt;, that my homie &lt;a href="http://www.redllamatech.com/"&gt;Peter Gruenbaum&lt;/a&gt; and I wrote at &lt;a href="http://www.leszynski.com/tabletpc/"&gt;Leszynski Group&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;But some mates of mine asked me about it last night, and I &lt;a href="'http://www.google.com/search?hl=en&amp;amp;q="physics+illustrator"'"&gt;googled it&lt;/a&gt;... whoa boy!&amp;nbsp; I've never seen such love and praise written about any piece of code I've touched.&amp;nbsp; Here are some hints, along with a few PI downloads, worth perhaps a few extra hours of fun...&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.windojitsu.com/blog/physicsillustratorhints.html"&gt;http://www.windojitsu.com/blog/physicsillustratorhints.html&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=408286" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>A Bug Story</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2005/01/13/352542.aspx" /><id>http://weblogs.asp.net/savanness/archive/2005/01/13/352542.aspx</id><published>2005-01-13T23:42:00Z</published><updated>2005-01-13T23:42:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.windojitsu.com/blog/bugstory.html"&gt;http://www.windojitsu.com/blog/bugstory.html&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Discuss...&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=352542" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>Copy Constructors vs ICloneable -- Redux</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2004/05/21/138263.aspx" /><id>http://weblogs.asp.net/savanness/archive/2004/05/21/138263.aspx</id><published>2004-05-21T22:24:00Z</published><updated>2004-05-21T22:24:00Z</updated><content type="html">&lt;P&gt;Back in 2002, I wrote an &lt;A href="http://www.ondotnet.com/pub/a/dotnet/2002/11/25/copying.html"&gt;article for ONDotNet.com&lt;/A&gt;, about .NET's copying, cloning, and marshalling semantics.&amp;nbsp; I suggested that the role of C++ style copy constructors was diminished, in the face of ICloneable.&amp;nbsp; Boy, was I wrong...&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.windojitsu.com/blog/copyctorvsicloneable.html"&gt;http://www.windojitsu.com/blog/copyctorvsicloneable.html&lt;/A&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=138263" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>Assembly Versioning Code of Ethics (or: Dipping Your Toes in the Warm, Gentle Waters of Code-Gen)</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2003/09/17/27906.aspx" /><id>http://weblogs.asp.net/savanness/archive/2003/09/17/27906.aspx</id><published>2003-09-17T08:18:00Z</published><updated>2003-09-17T08:18:00Z</updated><content type="html">&lt;P&gt;Prompted by an &lt;A href="http://discuss.develop.com/archives/wa.exe?A2=ind0309c&amp;amp;L=dotnet-clr&amp;amp;T=0&amp;amp;F=&amp;amp;S=&amp;amp;P=7940"&gt;email on the dotnet-clr list&lt;/A&gt;, I took a moment to write down my &lt;I&gt;&lt;B&gt;Assembly Versioning Code of Ethics&lt;/B&gt;&lt;/I&gt;. These rules are not enforced by .NET or the CLR in any way -- but I think I speak for virtuous developers everywhere when I say:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;I.&amp;nbsp; Thou shalt bump &lt;I&gt;at least&lt;/I&gt; the "minor" field, when making a change that might affect existing client code.&lt;/P&gt;
&lt;P&gt;II.&amp;nbsp; Thou shalt bump &lt;I&gt;at least&lt;/I&gt; the "revision" field, when making any other change, whatsoever.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I hate to make an example out of anyone, but a certain SDK team at MS has broken both of these simple commandments over the past 18 months, and each time it's caused quite a lot of frustration.&lt;/P&gt;
&lt;P&gt;Post RTM, the Tablet PC team has published one additional point-release of their SDK.&amp;nbsp; They bumped the version number on the &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;Microsoft.Ink.dll&lt;/FONT&gt;&lt;/SPAN&gt; assembly (the managed wrapper for the Tablet API) from &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;v1.0.2201.0 &lt;/FONT&gt;&lt;/SPAN&gt;to &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;v1.0.2201.2&lt;/FONT&gt;&lt;/SPAN&gt;.&amp;nbsp; Now, I don't know what happened to the intervening &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;2201.1&lt;/FONT&gt;&lt;/SPAN&gt; release, but still, the small hop from &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;2201.0&lt;/FONT&gt;&lt;/SPAN&gt; to &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;2201.2&lt;/FONT&gt;&lt;/SPAN&gt; certainly looks like a innocuous little bug-fix patch, right?&lt;/P&gt;
&lt;P&gt;But no -- they've added &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;IDisposable&lt;/FONT&gt;&lt;/SPAN&gt; implementations to about half a dozen of the most heavily-used classes, and updated the &lt;A href="http://support.microsoft.com/?kbid=331956"&gt;documentation&lt;/A&gt; to imply that if we don't call &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;Dispose()&lt;/FONT&gt;&lt;/SPAN&gt; then our apps will leak -- that's a breaking change, darnnit!&lt;/P&gt;
&lt;P&gt;Prior to the RTM release of the SDK, they were guilty of the second sin, as well: distributing multiple versions of the assembly, all&amp;nbsp;under the &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;v1.0.2201.0&lt;/FONT&gt;&lt;/SPAN&gt; label.&amp;nbsp; It was unfeasibly difficult to distinguish between them "in the field" (eg: on a coworker's misbehaving test box).&amp;nbsp; These doppelganger assemblies were just internal alpha and/or beta releases, but still, such needless confusion -- why?&lt;/P&gt;
&lt;P&gt;I know why.&amp;nbsp; In fact, I'm guessing this story sounds painfully familiar to a lot of readers out there.&amp;nbsp; The problem is human: it's a royal p.i.t.a. for developers to remember to bump the revision number, by hand, with each build they send off to the QA department.&amp;nbsp; In the unmanaged world, binaries were (usually) not signed, and so details like version-info could be patched up in the very last build stages, by setup/integration engineers whose jobs it is to think about these things.&amp;nbsp; &lt;EM&gt;Versioning is too important to rely on 100% unfailing compliance from 100% of all developers on your team.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The good news: with just five minutes of effort, you can automate this problem out of existence!&lt;/P&gt;
&lt;P&gt;I've become fond of auto-generating an &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;AssemblyVersion.cs&lt;/FONT&gt;&lt;/SPAN&gt; file, pre-build, with the low-order 32 bits of the version number (the build- and revision-fields) based loosely on the current date and time.&lt;/P&gt;
&lt;P&gt;For example: if I released a new product right now, I might stamp it &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;v1.0.2003.916&lt;/FONT&gt;&lt;/SPAN&gt;... Or maybe even &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;v1.0.2003.9169&lt;/FONT&gt;&lt;/SPAN&gt; -- where the last digit (9) is computed something like &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;(10*DateTime.Now.Hour/24)&lt;/FONT&gt;&lt;/SPAN&gt;.&amp;nbsp; We only have 16 bits per field to work with, so we mustn't go crazy trying to squeeze in a full-&lt;BR&gt;fidelity timestamp -- it won't happen, and it's not worth sacrificing the readability of the build-date in the version.&lt;/P&gt;
&lt;P&gt;Some might be tempted to go further down the "version == build-time" road, eg: &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;v2003.9.16.2315&lt;/FONT&gt;&lt;/SPAN&gt;... but that doesn't easily let one release, say, a new security patch for a product that's one or more revs past its prime.&lt;/P&gt;
&lt;P&gt;Why not?&amp;nbsp; In .NET, version numbers are &lt;I&gt;comparable &lt;/I&gt;(in the &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;System.IComparable&lt;/FONT&gt;&lt;/SPAN&gt; sense) so it's not cool to release a new patch for last year's code, which compares as anywhere close to the same patch for the &lt;I&gt;current &lt;/I&gt;generation product. This is not just academic: someday, you or your users may wish to apply binding-redirect policies to your software, based on declared ranges of version numbers!&amp;nbsp; Reserving the high-order fields in the version number to represent a logical product release is a huge help, in that case.&lt;/P&gt;
&lt;P&gt;Besides, there's an alternative available:&amp;nbsp; If you really want to stamp your assemblies with a human-readable, full-fidelity build timestamp, check out &lt;A href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemReflectionAssemblyInformationalVersionAttributeClassTopic.asp"&gt;the AssemblyInformationalVersion attribute&lt;/A&gt;, which allows you to supply a whole string, of your own devising (eg: &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;DateTime.Now.ToString()&lt;/FONT&gt;&lt;/SPAN&gt; ;-).&lt;/P&gt;
&lt;P&gt;Here's the &lt;A href="http://www.arithex.com/xcc.html"&gt;X-Code .NET&lt;/A&gt; template I use to generate an &lt;SPAN class=code&gt;&lt;FONT face="Courier New"&gt;AssemblyVersion.cs&lt;/FONT&gt;&lt;/SPAN&gt; file, for all my C# projects.&amp;nbsp; (This technique, if not the exact template code, should be easily portable to &lt;A href="http://www.ericjsmith.net/codesmith/"&gt;CodeSmith&lt;/A&gt; or other template-based preprocessors.)&amp;nbsp; The end result? I sleep soundly at night, knowing that my build environment will automatically and unfailingly increment my assembly version number, every&amp;nbsp;few hours.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR: #dfdf7f"&gt;&lt;FONT color=#000080&gt;&lt;B&gt;var&lt;/B&gt;&lt;/FONT&gt; now:DateTime = DateTime.Now;
&lt;FONT color=#000080&gt;&lt;B&gt;var&lt;/B&gt;&lt;/FONT&gt; build:&lt;FONT color=#000080&gt;&lt;B&gt;short&lt;/B&gt;&lt;/FONT&gt; = (&lt;B&gt;&lt;FONT color=#000080&gt;short&lt;/FONT&gt;&lt;/B&gt;)(now.Year);
&lt;B&gt;&lt;FONT color=#000080&gt;var&lt;/FONT&gt;&lt;/B&gt; revision:&lt;FONT color=#000080&gt;&lt;B&gt;short&lt;/B&gt;&lt;/FONT&gt; = (&lt;B&gt;&lt;FONT color=#000080&gt;short&lt;/FONT&gt;&lt;/B&gt;)(now.Month*&lt;FONT color=#007f7f&gt;1000&lt;/FONT&gt; + now.Day*&lt;FONT color=#007f7f&gt;10&lt;/FONT&gt; + now.Hour*&lt;FONT color=#007f7f&gt;10&lt;/FONT&gt;/&lt;FONT color=#007f7f&gt;24&lt;/FONT&gt;);
&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;

&lt;/SPAN&gt;[assembly: System.Reflection.AssemblyVersion(
 "&lt;SPAN style="BACKGROUND-COLOR: #ffff00"&gt;&amp;lt;%=&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #dfdf7f"&gt; major &lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;.&amp;lt;%=&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #dfdf7f"&gt; minor &lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;.&amp;lt;%=&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #dfdf7f"&gt; build &lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;.&amp;lt;%=&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #dfdf7f"&gt; revision &lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00"&gt;%&amp;gt;&lt;/SPAN&gt;"
 )]&lt;/PRE&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=27906" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>VS.NET Tip of the Day: Reusing C# Source Code Across Multiple Assemblies</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2003/07/22/10417.aspx" /><id>http://weblogs.asp.net/savanness/archive/2003/07/22/10417.aspx</id><published>2003-07-23T00:34:00Z</published><updated>2003-07-23T00:34:00Z</updated><content type="html">&lt;p&gt;I'm surprised by how many people don't know this trick...  but equally surprised by how obscure the UI is.&lt;/p&gt;
&lt;h3&gt;The Problem&lt;/h3&gt;
&lt;p&gt;Let's say you have a clever little bit of C# code you'd like to reuse, but it's something too trivial to warrant its building, supporting, and maintaining its own assembly.  Or perhaps the code is something proptrietary, and you'd like to obfuscate it as fully as possible -- which usually means not exposing it in any public types.  Or perhaps it's just a small set of compile-time constants that you'd like to bring into multiple assemblies.&lt;/p&gt;
&lt;p&gt;As a trivially simple example, perhaps you get tired of specifying the same AssemblyCompany and AssemblyCopyright strings, over and over again, in all your projects?  Wouldn't it be nice to have a little two-line C# file tucked away somewhere, and include it by reference in all your projects?&lt;/p&gt;&lt;pre&gt;[assembly: System.Reflection.AssemblyCompany("Arithex.com")]&lt;br /&gt;[assembly: System.Reflection.AssemblyCopyright("© 2003 Shawn A. Van Ness. All rights reserved.")] &lt;/pre&gt;
&lt;p&gt;With C++ this is trivial -- you create a header file, and #include it from wherever you like.  But C# doesn't have a #include directive.  Or does it?&lt;/p&gt;
&lt;h3&gt;The Solution&lt;/h3&gt;
&lt;p&gt;No, it doesn't (sorry to tease ;-).  But Visual Studio .NET does offer a way to bring in C# code from a source file that's nowhere near the rest of the source files in your project directory -- it's not intra-file lexicographic inclusion, as in C++, but every C# source file can see every other C# source file in the build, so in practice there's not much difference!&lt;/p&gt;
&lt;p&gt;Unfortunately, the UI to accomplish this task is pretty obscure -- which is probably why I run into so few developers who know about it.  It's so obscure, in fact, that I often find it easier to close VS and hack the .csproj file manually.  Here's what a &amp;lt;File&amp;gt; element might look like, for a C# project file (a .csproj file) that references a shared definition for my hypothetical AssemblyCompany and AssemblyCopyright strings, above:&lt;/p&gt;&lt;pre&gt;   &amp;lt;File&lt;br /&gt;      RelPath = "AssemblyCompanyAndCopyright.cs"&lt;br /&gt;      Link = "..\..\AssemblyCompanyAndCopyright.cs"&lt;br /&gt;      SubType = "Code"&lt;br /&gt;      BuildAction = "Compile"&lt;br /&gt;   /&amp;gt;&lt;/pre&gt;
&lt;p&gt;Note that "RelPath" attribute is not, as you might think, a relative path to the file.  That would make sense!  Rather, it's the relative path of where the node will appear in the Solution Explorer treeview.  (This is the same "RelPath" attribute that you see on every other file in your C# project.)  The "Link" attribute is the interesting one -- that's the relative path to the actual file (relative to the .csproj file).  In Solution Explorer, the "linked' file will appear with an Explorer-style shortcut arrow emblazoned over its icon.&lt;/p&gt;
&lt;p&gt;If you have some trepidation about hacking up your .csproj files, or if you absolutely, positively insist on using a mouse...  right-click your project in Solutions Explorer, and select Add Existing Item.  Browse to your shared C# source file, then click the unnoticeable little dropdown arrow next to the Open button.  See the ctxmenu item entitled "Link File"?  That's your man.&lt;/p&gt;
&lt;h3&gt;The Catch&lt;/h3&gt;
&lt;p&gt;(There's always a catch.)  For anything more complex than assembly-level attributes, one must think carefully about duplicating C# code across multiple assemblies.  Consider the following hypothetical SharedConstants.cs file...&lt;/p&gt;&lt;pre&gt;using System;&lt;br /&gt;namespace MyCompany {&lt;br /&gt;internal class SharedConstants {&lt;br /&gt;&lt;br /&gt;    public const string Hello = "Hello";&lt;br /&gt;    public const string World = "World";&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;This will produce a new, different type named MyCompany.SharedConstants in each and every assembly you "include" it in.  If the constants are large, or if the sanctity of SharedConstants' type-identity is important to you (imagine, perhaps, defining an enum this way, then later developing methods and properties which attempt to pass parameters of that type across assembly boundaries) then this approach may be undesirable -- or it may flat out break.&lt;/p&gt;
&lt;p&gt;In that case, your only real option is to build a shared assembly which defines the constants (or enumeration values, etc), then ref that assembly in your other projects.  And that is, of course, what the founding fathers of .NET intended.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=10417" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>Back from Japan...</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2003/06/30/9510.aspx" /><id>http://weblogs.asp.net/savanness/archive/2003/06/30/9510.aspx</id><published>2003-07-01T00:38:00Z</published><updated>2003-07-01T00:38:00Z</updated><content type="html">&lt;p&gt;Just got back from a week-long training gig in Tokyo...  Our newly developed class on Developing Tablet PC applications in C# has finally started to mature -- it's good stuff.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://tabletpctraining.com/"&gt;http://tabletpctraining.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But delivering it to an audience that, for the most part, doesn't speak English (I had a team of interpreters helping me out) and who are using Japanese VS 7.0 on Japanese XP... whoa.  What an experience!  Those interpreters were amazing.  Truly talented souls...  I'm sure they're underpaid.&lt;/p&gt;
&lt;p&gt;As for me?  I don't speak a word of Japanese.  Kanjii is like Greek... err, actually, Greek is much more familiar to me.  But as it happens, almost all of the keyboard shortcuts are the same on Japanese XP/VS, as in English!  And those of you who know me, know how I work -- I don't do anything, without I memorize a keyboard shortcut.&lt;/p&gt;
&lt;p&gt;So.  Jet-lag notwithstanding, I was up all night before the first day of class, back-converting all our labs' project files from VS 7.1 to 7.0.  Decompiling our helper components with ILDasm v1.1, hacking all the refs back from 1.0.5000 to 1.0.3300, then rebuiding with ILAsm v1.0.  Damn, do I love .NET...!&lt;/p&gt;
&lt;p&gt;And speaking of underpaid interpreters...  I'm floored by the sheer cost of this trip!  Some places in Tokyo want ¥2,000 for a cup of coffee.  That's, like, US$20.00!!!  And not a latte, mind you -- just a brewed cup of coffee.  (I was afraid to ask for a refill.)&lt;/p&gt;
&lt;p&gt;And economists covering the Japanese markets have the nerve to complain about deflation... umm...?!?!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9510" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>NtfsDisable8dot3NameCreation is your friend</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2003/06/09/8445.aspx" /><id>http://weblogs.asp.net/savanness/archive/2003/06/09/8445.aspx</id><published>2003-06-09T21:31:00Z</published><updated>2003-06-09T21:31:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.google.com/search?q=NtfsDisable8dot3NameCreation"&gt;http://www.google.com/search?q=NtfsDisable8dot3NameCreation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you haven't done so already, I highly recommend setting this tweak in your registry, and rebooting.&lt;/p&gt;
&lt;p&gt;It's cute when the dir command treats *.htm like *.html; it's devastating when the del command interprets *.res as *.resx.&lt;/p&gt;
&lt;p&gt;Setting &lt;a href="http://support.microsoft.com/?scid=210638"&gt;NtfsDisable8dot3NameCreation&lt;/a&gt; will supress the creation of shortnames for new files, but the only way I know of to remove shortname entries for existing files is to rename them.&lt;/p&gt;&lt;pre&gt;for /r %I in (*) do @ren "%I" "%~nxI.no8dot3" &amp;amp;&amp;amp; ren "%I.no8dot3" "%~nxI"&lt;br /&gt;for /d /r %I in (*) do @ren "%I" "%~nxI.no8dot3" &amp;amp;&amp;amp; ren "%I.no8dot3" "%~nxI"&lt;/pre&gt;
&lt;p&gt;But be careful -- only do this for data files, not for anything might be installed/registered software.  Your registry is full of shortnames pointing into your ProgramFiles folder!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8445" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>All quiet along the Toolbox front...</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2003/04/24/6012.aspx" /><id>http://weblogs.asp.net/savanness/archive/2003/04/24/6012.aspx</id><published>2003-04-24T09:03:00Z</published><updated>2003-04-24T09:03:00Z</updated><content type="html">&lt;P&gt;&lt;A href="http://www.google.com/search?q=toolbox+site%3Adotnetweblogs.com"&gt;The saga&lt;/A&gt; continues.&amp;nbsp; Soon after I &lt;A href="http://dotnetweblogs.com/SAVanNess/posts/5701.aspx"&gt;reported&lt;/A&gt; the terrible timing-sensitive bug in the VS automation layer, I got a friendly email from someone smarter than me, and with a microsoft.com email address.&amp;nbsp; That's the kind I like..!&lt;/P&gt;
&lt;P&gt;I've forgotten how most&amp;nbsp;of this COM/OLE goo works, but this kind soul reminded me that &lt;A href="http://msdn.microsoft.com/library/en-us/com/htm/cmf_a2c_929e.asp"&gt;OLE message filters&lt;/A&gt; (ala IMessageFilter, but not &lt;A href="http://www.dotnet247.com/247reference/System/Windows/Forms/IMessageFilter.aspx"&gt;the one&lt;/A&gt; you're thinking of!) are the key to avoiding call-rejected errors from COM plumbing.&lt;/P&gt;
&lt;P&gt;Code follows.&amp;nbsp; Caveat emptor -- but it works for me!&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;using&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;System;
&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;using&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;System.Runtime.InteropServices;

&lt;SPAN class=blockcomment&gt;&lt;FONT color=#006400&gt;/*
This&amp;nbsp;class&amp;nbsp;implements&amp;nbsp;an&amp;nbsp;OLE&amp;nbsp;message&amp;nbsp;filter,&amp;nbsp;appropriate&amp;nbsp;for&amp;nbsp;use&amp;nbsp;with&amp;nbsp;the&amp;nbsp;VS&amp;nbsp;automation&amp;nbsp;clients.

Sample&amp;nbsp;usage:

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[STAThread]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;static&amp;nbsp;void&amp;nbsp;Main()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;We&amp;nbsp;avoid&amp;nbsp;instantiating&amp;nbsp;the&amp;nbsp;RCW&amp;nbsp;as&amp;nbsp;"new&amp;nbsp;DTE()",&amp;nbsp;because&amp;nbsp;the&amp;nbsp;both&amp;nbsp;PIAs&amp;nbsp;for&amp;nbsp;v7.0&amp;nbsp;and&amp;nbsp;v7.1&amp;nbsp;point&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;to&amp;nbsp;the&amp;nbsp;same&amp;nbsp;CLSID&amp;nbsp;(VS&amp;nbsp;7.0's)...&amp;nbsp;&lt;GROAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Type&amp;nbsp;latestDTE&amp;nbsp;=&amp;nbsp;Type.GetTypeFromProgID("VisualStudio.DTE");&amp;nbsp;//ver-indep&amp;nbsp;progid
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;EnvDTE.DTE&amp;nbsp;dte&amp;nbsp;=&amp;nbsp;Activator.CreateInstance(latestDTE)&amp;nbsp;as&amp;nbsp;EnvDTE.DTE;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Register&amp;nbsp;an&amp;nbsp;OLE&amp;nbsp;message&amp;nbsp;filter&amp;nbsp;to&amp;nbsp;avoid&amp;nbsp;"call&amp;nbsp;rejected"&amp;nbsp;exceptions
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MessageFilter.Register();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Drive&amp;nbsp;the&amp;nbsp;VS&amp;nbsp;automation&amp;nbsp;interface
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Installer1.AddToolBoxTab(dte);&amp;nbsp;//&amp;nbsp;or&amp;nbsp;whatever

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Unplug&amp;nbsp;the&amp;nbsp;message&amp;nbsp;filter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MessageFilter.Revoke();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
*/&lt;/FONT&gt;&lt;/SPAN&gt;

&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;class&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;MessageFilter&amp;nbsp;:&amp;nbsp;IOleMessageFilter
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//
&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//&amp;nbsp;Public&amp;nbsp;API
&lt;/FONT&gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;public&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;static&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;void&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;Register()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IOleMessageFilter&amp;nbsp;newfilter&amp;nbsp;=&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;new&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;MessageFilter();&amp;nbsp;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IOleMessageFilter&amp;nbsp;oldfilter&amp;nbsp;=&amp;nbsp;&lt;SPAN class=otherliteral&gt;&lt;FONT color=#8b0000&gt;null&lt;/FONT&gt;&lt;/SPAN&gt;;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CoRegisterMessageFilter(newfilter,&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;out&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;oldfilter);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;public&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;static&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;void&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;Revoke()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IOleMessageFilter&amp;nbsp;oldfilter&amp;nbsp;=&amp;nbsp;&lt;SPAN class=otherliteral&gt;&lt;FONT color=#8b0000&gt;null&lt;/FONT&gt;&lt;/SPAN&gt;;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CoRegisterMessageFilter(&lt;SPAN class=otherliteral&gt;&lt;FONT color=#8b0000&gt;null&lt;/FONT&gt;&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;out&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;oldfilter);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//
&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//&amp;nbsp;IOleMessageFilter&amp;nbsp;impl
&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;IOleMessageFilter.HandleInComingCall(&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwCallType,&amp;nbsp;System.IntPtr&amp;nbsp;hTaskCaller,&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwTickCount,&amp;nbsp;System.IntPtr&amp;nbsp;lpInterfaceInfo)&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Diagnostics.Debug.WriteLine(&lt;SPAN class=stringliteral&gt;&lt;FONT color=#8b0000&gt;"IOleMessageFilter::HandleInComingCall"&lt;/FONT&gt;&lt;/SPAN&gt;);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;return&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=numericliteral&gt;&lt;FONT color=#8b0000&gt;0&lt;/FONT&gt;&lt;/SPAN&gt;;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//SERVERCALL_ISHANDLED
&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;IOleMessageFilter.RetryRejectedCall(System.IntPtr&amp;nbsp;hTaskCallee,&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwTickCount,&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwRejectType)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Diagnostics.Debug.WriteLine(&lt;SPAN class=stringliteral&gt;&lt;FONT color=#8b0000&gt;"IOleMessageFilter::RetryRejectedCall"&lt;/FONT&gt;&lt;/SPAN&gt;);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;if&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;(dwRejectType&amp;nbsp;==&amp;nbsp;&lt;SPAN class=numericliteral&gt;&lt;FONT color=#8b0000&gt;2&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;)&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//SERVERCALL_RETRYLATER
&lt;/FONT&gt;&lt;/SPAN&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;System.Diagnostics.Debug.WriteLine(&lt;SPAN class=stringliteral&gt;&lt;FONT color=#8b0000&gt;"Retry&amp;nbsp;call&amp;nbsp;later"&lt;/FONT&gt;&lt;/SPAN&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 class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;return&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=numericliteral&gt;&lt;FONT color=#8b0000&gt;99&lt;/FONT&gt;&lt;/SPAN&gt;;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//retry&amp;nbsp;immediately&amp;nbsp;if&amp;nbsp;return&amp;nbsp;&amp;gt;=0&amp;nbsp;&amp;amp;&amp;nbsp;&amp;lt;100
&lt;/FONT&gt;&lt;/SPAN&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 class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;return&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;-&lt;SPAN class=numericliteral&gt;&lt;FONT color=#8b0000&gt;1&lt;/FONT&gt;&lt;/SPAN&gt;;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//cancel&amp;nbsp;call
&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;IOleMessageFilter.MessagePending(System.IntPtr&amp;nbsp;hTaskCallee,&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwTickCount,&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwPendingType)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Diagnostics.Debug.WriteLine(&lt;SPAN class=stringliteral&gt;&lt;FONT color=#8b0000&gt;"IOleMessageFilter::MessagePending"&lt;/FONT&gt;&lt;/SPAN&gt;);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;return&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=numericliteral&gt;&lt;FONT color=#8b0000&gt;2&lt;/FONT&gt;&lt;/SPAN&gt;;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//PENDINGMSG_WAITDEFPROCESS&amp;nbsp;
&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//
&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//&amp;nbsp;Implementation
&lt;/FONT&gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[DllImport(&lt;SPAN class=stringliteral&gt;&lt;FONT color=#8b0000&gt;"Ole32.dll"&lt;/FONT&gt;&lt;/SPAN&gt;)]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;private&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;static&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;extern&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;CoRegisterMessageFilter(IOleMessageFilter&amp;nbsp;newfilter,&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;out&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;IOleMessageFilter&amp;nbsp;oldfilter);
}

[ComImport(),&amp;nbsp;Guid(&lt;SPAN class=stringliteral&gt;&lt;FONT color=#8b0000&gt;"00000016-0000-0000-C000-000000000046"&lt;/FONT&gt;&lt;/SPAN&gt;),&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;interface&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;IOleMessageFilter&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//&amp;nbsp;deliberately&amp;nbsp;renamed&amp;nbsp;to&amp;nbsp;avoid&amp;nbsp;confusion&amp;nbsp;w/&amp;nbsp;System.Windows.Forms.IMessageFilter
&lt;/FONT&gt;&lt;/SPAN&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[PreserveSig]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;HandleInComingCall(&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwCallType,&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IntPtr&amp;nbsp;hTaskCaller,&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwTickCount,&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IntPtr&amp;nbsp;lpInterfaceInfo);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[PreserveSig]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;RetryRejectedCall(&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IntPtr&amp;nbsp;hTaskCallee,&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwTickCount,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwRejectType);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[PreserveSig]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;MessagePending(&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IntPtr&amp;nbsp;hTaskCallee,&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwTickCount,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;dwPendingType);
}
&lt;/PRE&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6012" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry><entry><title>Revenge of the Toolbox: Part Deux</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/savanness/archive/2003/04/15/5701.aspx" /><id>http://weblogs.asp.net/savanness/archive/2003/04/15/5701.aspx</id><published>2003-04-16T02:53:00Z</published><updated>2003-04-16T02:53:00Z</updated><content type="html">&lt;P&gt;Everybody has been following along with my little &lt;A href="http://dotnetweblogs.com/SAVanNess/posts/5352.aspx"&gt;toolbox saga&lt;/A&gt;, right?&lt;/P&gt;
&lt;P&gt;It just doesn't let up.&amp;nbsp; Today it threw me another curve -- a timing bug! -- apparently it's failing in our test lab, on slow machines (think: sub-900 MHz laptops, w/ slow busses).&lt;/P&gt;
&lt;P&gt;Sometimes I get a "call was rejected by the callee" exception, sometimes just silent failure (no exceptions, but no new toolbox items either).&amp;nbsp; When the exceptions do occur, it's never in a predictable spot (just one of the several calls in to VS).&lt;/P&gt;
&lt;P&gt;The bug seems to manifest on both VS 7.0 and 7.1, but I'm not 100% sure of that.&amp;nbsp; I managed to repro on my high-end dev box, by cranking my &lt;A href="mailto:SETI@Home"&gt;SETI@Home&lt;/A&gt; client's process priority up to "high".&amp;nbsp; ;-)&lt;/P&gt;
&lt;P&gt;Sprinkling around a few Thread.Sleep calls seems to fix the problem nicely... well, not "nicely", but what else can I do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//&amp;nbsp;Get&amp;nbsp;DTE&amp;nbsp;from&amp;nbsp;version-indep&amp;nbsp;progid&amp;nbsp;(points&amp;nbsp;to&amp;nbsp;newest)&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Type&amp;nbsp;latestDTE&amp;nbsp;=&amp;nbsp;Type.GetTypeFromProgID(&lt;SPAN class=stringliteral&gt;&lt;FONT color=#8b0000&gt;"VisualStudio.DTE"&lt;/FONT&gt;&lt;/SPAN&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;EnvDTE.DTE&amp;nbsp;dte&amp;nbsp;=&amp;nbsp;Activator.CreateInstance(latestDTE)&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;as&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&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;EnvDTE.DTE;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//&amp;nbsp;Repeat&amp;nbsp;attempt&amp;nbsp;to&amp;nbsp;drive&amp;nbsp;VS,&amp;nbsp;with&amp;nbsp;ever-increasing&amp;nbsp;handicap&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;for&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;(&lt;SPAN class=builtintype&gt;&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;delayFudge=&lt;SPAN class=numericliteral&gt;&lt;FONT color=#8b0000&gt;100&lt;/FONT&gt;&lt;/SPAN&gt;;&amp;nbsp;delayFudge&amp;nbsp;&amp;lt;&amp;nbsp;&lt;SPAN class=numericliteral&gt;&lt;FONT color=#8b0000&gt;5000&lt;/FONT&gt;&lt;/SPAN&gt;;&amp;nbsp;delayFudge&amp;nbsp;+=&amp;nbsp;&lt;SPAN class=numericliteral&gt;&lt;FONT color=#8b0000&gt;1000&lt;/FONT&gt;&lt;/SPAN&gt;)&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 class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;try&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&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;AddToolboxItems(dte,delayFudge);&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 class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;break&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;;&amp;nbsp;&lt;SPAN class=linecomment&gt;&lt;FONT color=#006400&gt;//&amp;nbsp;exit&amp;nbsp;loop&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&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 class=keyword&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;catch&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;(Exception&amp;nbsp;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;Debug.WriteLine(ex.Message&amp;nbsp;+&amp;nbsp;&lt;SPAN class=stringliteral&gt;&lt;FONT color=#8b0000&gt;"\nTrying&amp;nbsp;again..."&lt;/FONT&gt;&lt;/SPAN&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;}&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;At what point do I just give up, and look for a new job?&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5701" width="1" height="1"&gt;</content><author><name>Shawn A. Van Ness</name><uri>http://weblogs.asp.net/members/Shawn-A.-Van-Ness.aspx</uri></author></entry></feed>