<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Pursuit Of A Life &#187; Snapper</title>
	<atom:link href="http://thepursuitofalife.com/tag/snapper/feed/" rel="self" type="application/rss+xml" />
	<link>http://thepursuitofalife.com</link>
	<description>Wouldn&#039;t you rather be writing code?</description>
	<lastBuildDate>Fri, 19 Mar 2010 03:12:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WebBrowser Control Can&#8217;t Be Hosted in Class Library</title>
		<link>http://thepursuitofalife.com/webbrowser-control-cant-be-hosted-in-class-library/</link>
		<comments>http://thepursuitofalife.com/webbrowser-control-cant-be-hosted-in-class-library/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 20:10:16 +0000</pubDate>
		<dc:creator>Anthony Stevens</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[ProcessStartInfo]]></category>
		<category><![CDATA[Snapper]]></category>
		<category><![CDATA[STA]]></category>
		<category><![CDATA[WebBrowser Control]]></category>

		<guid isPermaLink="false">http://xidey.wordpress.com/2008/01/07/webbrowser-control-cant-be-hosted-in-class-library/</guid>
		<description><![CDATA[So my previous initial hunch for a nice, compact architecture for my Snapper project turns out to be unworkable.  The reason?  The WebBrowser control is very finicky and can only be run in a UI thread.  Without claiming to be fully aware of the issues, it has something to do with the single-threaded-apartment (STA) model [...]]]></description>
			<content:encoded><![CDATA[<p>So my previous <a href="http://xidey.wordpress.com/2007/12/29/snapper-back-of-the-envelope-design-for-command-line-version/">initial hunch for a nice, compact architecture for my Snapper project</a> turns out to be unworkable.  The reason?  The WebBrowser control is very finicky and can only be run in a UI thread.  Without claiming to be fully aware of the issues, it has something to do with the single-threaded-apartment (STA) model that WinForms apps use vs. the multi-threaded apartment (MTA) model that is the default for .NET class libraries.</p>
<p>How does this affect my large-scale plans to provide full-page web snapshots to a variety of calling services, including:</p>
<ol>
<li>Command-line applications</li>
<li>MSBuild tasks</li>
<li>Web Services that return XML, a la Alexa</li>
<li>.ASHX services that return the image inline via HTTP</li>
<li>&#8230; and more?</li>
</ol>
<p>Well, it just got a whole lot more complicated.  Instead of the nice, in-process system I wanted, I now have to deal with .NET ProcessStartInfo() stuff to shell out to a (invisible) WinForms app that will instantiate the WebBrowser control, and save the resulting image somewhere that the calling application or library can access it.  Bah.</p>
]]></content:encoded>
			<wfw:commentRss>http://thepursuitofalife.com/webbrowser-control-cant-be-hosted-in-class-library/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebBrowser.DocumentComplete Firing Multiple Times: Solution</title>
		<link>http://thepursuitofalife.com/webbrowserdocumentcomplete-firing-multiple-times-solution/</link>
		<comments>http://thepursuitofalife.com/webbrowserdocumentcomplete-firing-multiple-times-solution/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 21:19:50 +0000</pubDate>
		<dc:creator>Anthony Stevens</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[DocumentCompleted]]></category>
		<category><![CDATA[ReadyState]]></category>
		<category><![CDATA[Snapper]]></category>
		<category><![CDATA[WebBrowser]]></category>

		<guid isPermaLink="false">http://xidey.wordpress.com/2007/12/29/webbrowserdocumentcomplete-firing-multiple-times-solution/</guid>
		<description><![CDATA[My previous hunch was correct: before you do any actual work in the DocumentComplete event handler, make sure the ReadyState of the control equals &#8220;Complete&#8221;.
Here&#8217;s the updated diagnostic output: notice the time taken drops to three seconds now that I&#8217;m not looping through the worker code eleven different times.
'Snapper.WinForm.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://xidey.wordpress.com/2007/12/29/webbrowserdocumentcompleted-firing-multiple-times/">previous hunch</a> was correct: before you do any actual work in the DocumentComplete event handler, make sure the ReadyState of the control equals &#8220;Complete&#8221;.</p>
<p>Here&#8217;s the updated diagnostic output: notice the time taken drops to three seconds now that I&#8217;m not looping through the worker code eleven different times.</p>
<p><code>'Snapper.WinForm.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
'Snapper.WinForm.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a\Microsoft.mshtml.dll'<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:15:03 PM - DocumentCompleted!<br />
12/29/2007 1:15:03 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:15:03 PM - DocumentCompleted!<br />
12/29/2007 1:15:03 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
12/29/2007 1:15:05 PM - DocumentCompleted!<br />
Interactive<br />
12/29/2007 1:15:06 PM - DocumentCompleted!<br />
Complete<br />
12/29/2007 1:15:06 PM - DocumentCompleted!<br />
Doing work..</code></p>
<p>It&#8217;s probably also the case that the WebBrowserDocumentCompletedEventArgs parameter of the DocumentCompleted event handler gives me additional info with which to discriminate this ReadyState. May have to look into that one.</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Snapper" rel="tag">Snapper</a>,<a href="http://technorati.com/tags/WebBrowser" rel="tag">WebBrowser</a>,<a href="http://technorati.com/tags/DocumentCompleted" rel="tag">DocumentCompleted</a>,<a href="http://technorati.com/tags/ReadyState" rel="tag">ReadyState</a></div>
]]></content:encoded>
			<wfw:commentRss>http://thepursuitofalife.com/webbrowserdocumentcomplete-firing-multiple-times-solution/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>WebBrowser.DocumentCompleted Firing Multiple Times</title>
		<link>http://thepursuitofalife.com/webbrowserdocumentcompleted-firing-multiple-times/</link>
		<comments>http://thepursuitofalife.com/webbrowserdocumentcompleted-firing-multiple-times/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 21:02:33 +0000</pubDate>
		<dc:creator>Anthony Stevens</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[DocumentCompleted]]></category>
		<category><![CDATA[Snapper]]></category>
		<category><![CDATA[WebBrowser]]></category>

		<guid isPermaLink="false">http://xidey.wordpress.com/2007/12/29/webbrowserdocumentcompleted-firing-multiple-times/</guid>
		<description><![CDATA[I&#8217;m running in to the same problem that Adi ran into wherein the DocumentCompleted event of the WebBrowser control is firing more than once.  Sometimes a lot of times!
Seems to me that this should be a Once and Only Once type of thing.
Here&#8217;s my diagnostic output when I open techcrunch.com: the timestamped lines are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running in to the same problem that Adi ran into wherein <a href="http://dotmad.blogspot.com/2007/05/webbrowserdocumentcompleted-is-raised.html">the DocumentCompleted event of the WebBrowser control is firing more than once</a>.  Sometimes a lot of times!</p>
<p>Seems to me that this should be a <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">Once and Only Once</a> type of thing.</p>
<p>Here&#8217;s my diagnostic output when I open techcrunch.com: the timestamped lines are the DocumentCompleted events; the others are the ProgressChanged events.</p>
<p><code>'Snapper.WinForm.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
Uninitialized<br />
'Snapper.WinForm.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a\Microsoft.mshtml.dll'<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:23 PM - DocumentCompleted!<br />
12/29/2007 1:00:24 PM - DocumentCompleted!<br />
12/29/2007 1:00:25 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:27 PM - DocumentCompleted!<br />
12/29/2007 1:00:29 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:31 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:33 PM - DocumentCompleted!<br />
Interactive<br />
12/29/2007 1:00:35 PM - DocumentCompleted!<br />
12/29/2007 1:00:36 PM - DocumentCompleted!<br />
Interactive<br />
Interactive<br />
12/29/2007 1:00:40 PM - DocumentCompleted!<br />
Complete<br />
12/29/2007 1:00:41 PM - DocumentCompleted!</code></p>
<p>Aside from the fact that it took 18 seconds to get this page&#8217;s contents in code (whereas FasterFox reports 8 seconds in Flock), having 11 DocumentCompleted events seems a little odd.</p>
<p><b>UPDATE:</b> Looking at this the answer seems to pop out at me.  Just wait for the ProgressChanged event to change to &#8220;Complete&#8221; before I do anything meaningful in the DocumentCompleted event handler.  I&#8217;ll give that a try right now.</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Snapper" rel="tag">Snapper</a>,<a href="http://technorati.com/tags/WebBrowser" rel="tag">WebBrowser</a>,<a href="http://technorati.com/tags/DocumentCompleted" rel="tag">DocumentCompleted</a></div>
]]></content:encoded>
			<wfw:commentRss>http://thepursuitofalife.com/webbrowserdocumentcompleted-firing-multiple-times/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Snapper Back-of-the-Envelope Design for Command Line Version</title>
		<link>http://thepursuitofalife.com/snapper-back-of-the-envelope-design-for-command-line-version/</link>
		<comments>http://thepursuitofalife.com/snapper-back-of-the-envelope-design-for-command-line-version/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 20:40:50 +0000</pubDate>
		<dc:creator>Anthony Stevens</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Snapper]]></category>

		<guid isPermaLink="false">http://xidey.wordpress.com/2007/12/29/snapper-back-of-the-envelope-design-for-command-line-version/</guid>
		<description><![CDATA[
Initial plan for the command-line app version of the little project I&#8217;ve taken to calling &#8220;Snapper&#8221;.
Technorati Tags: Snapper
]]></description>
			<content:encoded><![CDATA[<p><a href="http://thepursuitofalife.com/wp-content/uploads/2007/12/snapper-command-line-app1.png"><img src="http://thepursuitofalife.com/wp-content/uploads/2007/12/snapper-command-line-app-thumb1.png" style="border:0 none;" alt="Snapper Command-Line App" border="0" height="230" width="371" /></a></p>
<p>Initial plan for the command-line app version of <a href="http://xidey.wordpress.com/2007/12/27/mini-project-ill-be-working-on/">the little project</a> I&#8217;ve taken to calling &#8220;Snapper&#8221;.</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Snapper" rel="tag">Snapper</a></div>
]]></content:encoded>
			<wfw:commentRss>http://thepursuitofalife.com/snapper-back-of-the-envelope-design-for-command-line-version/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
