<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>John Stewien&#039;s Road To Somewhere Else</title>
	<atom:link href="https://johnstewien.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://johnstewien.wordpress.com</link>
	<description>John Stewien&#039;s blog</description>
	<lastBuildDate>Mon, 12 Dec 2011 09:26:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='johnstewien.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s-ssl.wordpress.com/i/buttonw-com.png</url>
		<title>John Stewien&#039;s Road To Somewhere Else</title>
		<link>https://johnstewien.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://johnstewien.wordpress.com/osd.xml" title="John Stewien&#039;s Road To Somewhere Else" />
	<atom:link rel='hub' href='https://johnstewien.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Family Shot</title>
		<link>https://johnstewien.wordpress.com/2010/04/03/family-shot/</link>
		<comments>https://johnstewien.wordpress.com/2010/04/03/family-shot/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 13:07:49 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2010/04/03/family-shot</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=6&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1304" class="bvMsg">
<p><a href="http://johnstewien.files.wordpress.com/2010/04/5724955535c7fa3f985e813d5189320b.jpg" rel="WLPP"><img border="0" src="http://johnstewien.files.wordpress.com/2010/04/5724955535c7fa3f985e813d5189320b.jpg?w=300" /></a></p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=6&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2010/04/03/family-shot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>

		<media:content url="http://johnstewien.files.wordpress.com/2010/04/5724955535c7fa3f985e813d5189320b.jpg?w=300" medium="image" />
	</item>
		<item>
		<title>Doing a join in an update in SQL for PostgreSQL</title>
		<link>https://johnstewien.wordpress.com/2010/03/15/doing-a-join-in-an-update-in-sql-for-postgresql/</link>
		<comments>https://johnstewien.wordpress.com/2010/03/15/doing-a-join-in-an-update-in-sql-for-postgresql/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 12:18:43 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Programming Tips and Tricks]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2010/03/15/doing-a-join-in-an-update-in-sql-for-postgresql</guid>
		<description><![CDATA[Was writing some SQL queries for PostgreSQL for updating some tables and did a touch of trial and error for getting the syntax right for doing a join within an update statement. Below is how I did it. I’m thinking &#8230; <a href="https://johnstewien.wordpress.com/2010/03/15/doing-a-join-in-an-update-in-sql-for-postgresql/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=9&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1289" class="bvMsg">
<p>Was writing some SQL queries for PostgreSQL for updating some tables and did a touch of trial and error for getting the syntax right for doing a join within an update statement. Below is how I did it. I’m thinking there should be a neater way.</p>
<p>update table1 set columnZ = newValue from table1 t1<br />inner join table2 t2<br />on t1.columnX = t2.columnY<br />where table1.uniqueID = t1.uniqueID<br />and t2.filterColumn = filterValue   </div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=9&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2010/03/15/doing-a-join-in-an-update-in-sql-for-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>
	</item>
		<item>
		<title>Recovered my dead / bricked acer aspire one</title>
		<link>https://johnstewien.wordpress.com/2010/02/21/recovered-my-dead-bricked-acer-aspire-one/</link>
		<comments>https://johnstewien.wordpress.com/2010/02/21/recovered-my-dead-bricked-acer-aspire-one/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 12:58:15 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2010/02/21/recovered-my-dead-bricked-acer-aspire-one</guid>
		<description><![CDATA[Had the Windows 7 Release Candidate on my Acer Aspire One, in the process of trying to reinstall XP from a USB key I ended up bricking my machine. Luckily I found the solution on this web page , my &#8230; <a href="https://johnstewien.wordpress.com/2010/02/21/recovered-my-dead-bricked-acer-aspire-one/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=8&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1279" class="bvMsg">
<p>Had the Windows 7 Release Candidate on my Acer Aspire One, in the process of trying to reinstall XP from a USB key I ended up bricking my machine. Luckily I found the solution on <a title="http://macles.blogspot.com/2008/08/acer-aspire-one-bios-recovery.html" href="http://macles.blogspot.com/2008/08/acer-aspire-one-bios-recovery.html" target="_blank">this web page</a> , my exact steps were:</p>
<p>I downloaded the latest BIOS from Acer Taiwan here <a title="here" href="http://twcsddl.acer.com.tw//acerdl/upload/Notebook/Aspireone/AOA150/BIOS//PGM26021-BI-3310FD.zip">here</a>.</p>
<p>Freshly formatted a USB key to FAT32.</p>
<p>Copied the 3 files (3310.fd, flashit.exe, 3310.bat) to the USB key.</p>
<p>Renamed 3310.fd to ZG5IA32.fd, renamed 3310.bat to ZG5IA32.bat, and changed the contents of the batch file (ZG5IA32.bat) to point to ZG5IA32.fd</p>
<p>Put the USB key in the left side USB port</p>
<p>With the netbook off, held down FN+ESC, turned on laptop, released FN+ESC when the power light started flashing, pressed the power button once, and the USB key started flashing for about 1 minute and then the laptop rebooted. Fixed!</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=8&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2010/02/21/recovered-my-dead-bricked-acer-aspire-one/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>
	</item>
		<item>
		<title>How to show a Child Window from a Console window in C#</title>
		<link>https://johnstewien.wordpress.com/2010/02/18/how-to-show-a-child-window-from-a-console-window-in-c/</link>
		<comments>https://johnstewien.wordpress.com/2010/02/18/how-to-show-a-child-window-from-a-console-window-in-c/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 11:45:50 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2010/02/18/how-to-show-a-child-window-from-a-console-window-in-c</guid>
		<description><![CDATA[An amusing little example I came up with of how to open a window that is a child window of a console window. Just in case I need it in the future. Also useful for spawning a window from an &#8230; <a href="https://johnstewien.wordpress.com/2010/02/18/how-to-show-a-child-window-from-a-console-window-in-c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=10&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1273" class="bvMsg">
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:black;font-size:10pt;">An amusing little example I came up with of how to open a window that is a child window of a console window. Just in case I need it in the future. Also useful for spawning a window from an OpenGL app, or hanging a child window off a separate thread.</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Times New Roman',serif;font-size:12pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:green;font-size:10pt;">// This is an example of how to open a Child Window from a Console</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:green;font-size:10pt;">// Window in C#.</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:green;font-size:10pt;">// By John Stewien 2010</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:green;font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System.Text;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System.Threading;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System.Runtime.InteropServices;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System.Windows.Forms;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">namespace</span><span style="font-family:'Courier New';font-size:10pt;"> ConsoleApplication &#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>  </span><span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>  </span><span style="color:gray;">///</span><span style="color:green;"> A simple form with a CheckBox that can be used to verify the</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>  </span><span style="color:gray;">///</span><span style="color:green;"> responsiveness of the Form.</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>  </span><span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>  </span><span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Form1</span> : <span style="color:#2b91af;">Form</span> &#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:blue;">public</span> Form1() &#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:#2b91af;">CheckBox</span> checkBox1 = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">CheckBox</span>();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>checkBox1.AutoSize = <span style="color:blue;">true</span>;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>checkBox1.Text = <span style="color:#a31515;">&quot;Check / Uncheck to test responsiveness&quot;</span>;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>Controls.Add(checkBox1);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>Text = <span style="color:#a31515;">&quot;Form1&quot;</span>;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>  </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>  </span><span style="color:blue;">class</span> <span style="color:#2b91af;">Program</span> &#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:green;">// Import the required Windows API functions</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:green;font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span>[<span style="color:#2b91af;">DllImport</span>(<span style="color:#a31515;">&quot;User32.dll&quot;</span>, CharSet = <span style="color:#2b91af;">CharSet</span>.Auto)]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:#2b91af;">IntPtr</span> FindWindow(<span style="color:blue;">char</span>[] lpClassName, <span style="color:blue;">char</span>[] lpWindowName);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span>[<span style="color:#2b91af;">DllImport</span>(<span style="color:#a31515;">&quot;User32.dll&quot;</span>, CharSet = <span style="color:#2b91af;">CharSet</span>.Auto)]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:blue;">static</span> <span style="color:blue;">extern</span> <span style="color:blue;">int</span> SetWindowLongW(<span style="color:#2b91af;">HandleRef</span> hWnd, <span style="color:blue;">int</span> nIndex, <span style="color:#2b91af;">IntPtr</span> dwNewLong);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:blue;">const</span> <span style="color:blue;">int</span> GWLP_HWNDPARENT = -8;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:green;">// Store these parameters as statics as they are called from static methods</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:green;font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:blue;">static</span> <span style="color:#2b91af;">IntPtr</span> consoleHWnd;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:blue;">static</span> <span style="color:#2b91af;">Form1</span> form;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;summary&gt;</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:gray;">///</span><span style="color:green;"> Method for running the form, called from a thread</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;">&lt;/summary&gt;</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:blue;">static</span> <span style="color:blue;">void</span> RunForm() &#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>form = <span style="color:blue;">new</span> <span style="color:#2b91af;">Form1</span>();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>SetWindowLongW(<span style="color:blue;">new</span> <span style="color:#2b91af;">HandleRef</span>(form, form.Handle), GWLP_HWNDPARENT, consoleHWnd);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:#2b91af;">Application</span>.Run(form);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:green;">// Delegate for invoking a method with no parameters</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:blue;">delegate</span> <span style="color:blue;">void</span> <span style="color:#2b91af;">SimpleDelegate</span>();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span><span style="color:blue;">static</span> <span style="color:blue;">void</span> Main(<span style="color:blue;">string</span>[] args) &#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:green;">// Set the Console Title and then find its HWND</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:#2b91af;">Console</span>.Title = <span style="color:#a31515;">&quot;Child Window On Console Test&quot;</span>;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>consoleHWnd = FindWindow(<span style="color:#a31515;">&quot;ConsoleWindowClass&quot;</span>.ToCharArray(), <span style="color:#2b91af;">Console</span>.Title.ToCharArray());</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:green;">// Run the Form</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:#2b91af;">Thread</span> thread = <span style="color:blue;">new</span> <span style="color:#2b91af;">Thread</span>(<span style="color:blue;">new</span> <span style="color:#2b91af;">ThreadStart</span>(RunForm));</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>thread.Start();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:green;">// Do some text stuff on the Console to show it is working</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;Enter Text. Enter \&quot;exit\&quot; to exit.&quot;</span>);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:blue;">string</span> text = <span style="color:#a31515;">&quot;&quot;</span>;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:blue;">while</span> (text != <span style="color:#a31515;">&quot;exit&quot;</span>)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>        </span>text = <span style="color:#2b91af;">Console</span>.ReadLine();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>   </span><span>   </span><span style="color:green;">// Close the Form so we can exit</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>form.Invoke(<span style="color:blue;">new</span> <span style="color:#2b91af;">SimpleDelegate</span>(form.Close));</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>    </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>  </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;">&#125;</span></p>
<p> </p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=10&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2010/02/18/how-to-show-a-child-window-from-a-console-window-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Oz Solomon’s Project Line Counter to work in VS2008</title>
		<link>https://johnstewien.wordpress.com/2010/01/15/getting-oz-solomon%e2%80%99s-project-line-counter-to-work-in-vs2008/</link>
		<comments>https://johnstewien.wordpress.com/2010/01/15/getting-oz-solomon%e2%80%99s-project-line-counter-to-work-in-vs2008/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 11:07:02 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2010/01/15/getting-oz-solomon%e2%80%99s-project-line-counter-to-work-in-vs2008</guid>
		<description><![CDATA[I&#8217;m a big fan of Oz Solomon&#8217;s Project Line Counter from here http://www.wndtabs.com/, however there isn&#8217;t a version for Visual Studio 2008. I&#8217;ve got a work around though Install the version for Visual Studio 2005, which fortunately installs even if &#8230; <a href="https://johnstewien.wordpress.com/2010/01/15/getting-oz-solomon%e2%80%99s-project-line-counter-to-work-in-vs2008/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=5&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1264" class="bvMsg">
<p>I&#8217;m a big fan of Oz Solomon&#8217;s Project Line Counter from here <a title="http://www.wndtabs.com/" href="http://www.wndtabs.com/">http://www.wndtabs.com/</a>, however there isn&#8217;t a version for Visual Studio 2008. I&#8217;ve got a work around though <img src='https://s-ssl.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Install the version for Visual Studio 2005, which fortunately installs even if Visual Studio 2005 isn&#8217;t present, then copy the following to notepad, save it and rename it to a .reg file, then double click it to enter it into the registry. After that, start VS2008 and you will see it there.</p>
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Addins\LineCount]<br />&quot;FriendlyName&quot;=&quot;Project Line Counter&quot;<br />&quot;AboutBoxDetails&quot;=&quot;Project Line Counter Addin  &#8211;  Build 2.21.2.1024<br />Copyright (c) 1999-2006 by Oz Solomon<br /><a href="http://www.wndtabs.com&quot;">http://www.wndtabs.com&quot;</a><br />&quot;AboutBoxIcon&quot;=&quot;C:\\Program Files\\WndTabs.com\\LineCount\\1033\\LineCountResources.dll,1&quot;<br />&quot;CommandLineSafe&quot;=dword:00000000<br />&quot;CommandPreload&quot;=dword:00000001<br />&quot;Descrption&quot;=&quot;Counts lines of code in your projects&quot;<br />&quot;LoadBehavior&quot;=dword:00000001<br />&quot;SatelliteDllName&quot;=&quot;LineCountResources.dll&quot;<br />&quot;SatelliteDllPath&quot;=&quot;C:\\Program Files\\WndTabs.com\\LineCount\\&quot;</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=5&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2010/01/15/getting-oz-solomon%e2%80%99s-project-line-counter-to-work-in-vs2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>
	</item>
		<item>
		<title>Taking a sunset photo with fill flash</title>
		<link>https://johnstewien.wordpress.com/2010/01/07/taking-a-sunset-photo-with-fill-flash/</link>
		<comments>https://johnstewien.wordpress.com/2010/01/07/taking-a-sunset-photo-with-fill-flash/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 10:56:32 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2010/01/07/taking-a-sunset-photo-with-fill-flash</guid>
		<description><![CDATA[I’ve recently acquired a new Canon 500D digital SLR camera, and I’ve been experimenting with different scenes. Some are trickier than others, e.g. to take a photo of my daughter with a sunset in the background required a bit of &#8230; <a href="https://johnstewien.wordpress.com/2010/01/07/taking-a-sunset-photo-with-fill-flash/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=11&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1259" class="bvMsg">
<p>I’ve recently acquired a new Canon 500D digital SLR camera, and I’ve been experimenting with different scenes. Some are trickier than others, e.g. to take a photo of my daughter with a sunset in the background required a bit of figuring out. Here’s one way of doing it:</p>
<p>1) Turn the mode dial to Aperture Priority<br />2) Set aperture to F stop 8.0<br />3) Set ISO to 200<br />4) Set exposure metering to spot metering<br />5) Set Auto Focus to One Shot<br />6) Close the built in flash<br />7) Point camera at daughter and half depress the shutter button to focus</p>
<p>While maintaining the shutter button in the half-depress (to hold the focus) do the following:</p>
<p>8) Point camera at the sky and press the Auto Exposure Lock button (AE button)<br />9) Press the flash release button to open the built in flash &#8211; this also changes the function AE button to a Flash measure button<br />10) Point camera at the whitest/brightest object in the foreground and press the AE button to fire off a pre-flash and set the flash strength<br />11) Repoint the camera at daughter and push the shutter button all the way down</p>
<p>One alternative is get up to step 9 by going full manual and setting up the exposure that way. </p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=11&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2010/01/07/taking-a-sunset-photo-with-fill-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>
	</item>
		<item>
		<title>HttpListener Proxy</title>
		<link>https://johnstewien.wordpress.com/2009/12/21/httplistener-proxy/</link>
		<comments>https://johnstewien.wordpress.com/2009/12/21/httplistener-proxy/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 11:30:43 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2009/12/21/httplistener-proxy</guid>
		<description><![CDATA[Just in case you find a use for some web proxy code&#8230;   I wrote a HttpListener proxy based on the HttpListener MSDN docs, and the web request code I did for something else. I had to do this because &#8230; <a href="https://johnstewien.wordpress.com/2009/12/21/httplistener-proxy/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=3&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1251" class="bvMsg">
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:Arial,sans-serif;font-size:10pt;">Just in case you find a use for some web proxy code&#8230;</span><span style="font-family:'Times New Roman',serif;font-size:12pt;"></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Times New Roman',serif;font-size:12pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:Arial,sans-serif;font-size:10pt;">I wrote a HttpListener proxy based on the HttpListener MSDN docs, and the web request code I did for something else. I had to do this because I needed to use the X-Plane updater from work which let me specify only an anonymous proxy, not the authenticated type that is at work. Here&#8217;s the code I got working for streaming binary data (note the HttpListener MSDN code only works for text as I discovered). </span><span style="font-family:'Times New Roman',serif;font-size:12pt;"></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Times New Roman',serif;font-size:12pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:Arial,sans-serif;font-size:10pt;">To test it I guess you could set a proxy in your web browser as 127.0.0.1:8080. The code below is the complete program.</span><span style="font-family:'Times New Roman',serif;font-size:12pt;"></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Times New Roman',serif;font-size:12pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System.Net;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System.Collections.Generic;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System.Text;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">using</span><span style="font-family:'Courier New';font-size:10pt;"> System.IO;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">namespace</span><span style="font-family:'Courier New';font-size:10pt;"> HttpListenerProxy</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;">&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:blue;">class</span> <span style="color:#2b91af;">RequestData</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span><span style="color:blue;">public</span> <span style="color:#2b91af;">HttpWebRequest</span> WebRequest;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span><span style="color:blue;">public</span> <span style="color:#2b91af;">HttpListenerContext</span> Context;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span><span style="color:blue;">public</span> RequestData(<span style="color:#2b91af;">HttpWebRequest</span> request, <span style="color:#2b91af;">HttpListenerContext</span> context)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>WebRequest = request;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>Context = context;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:blue;">class</span> <span style="color:#2b91af;">Program</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span><span style="color:blue;">static</span> <span style="color:blue;">void</span> Main(<span style="color:blue;">string</span>[] args)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:green;">// Create a listener.</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:#2b91af;">HttpListener</span> listener = <span style="color:blue;">new</span> <span style="color:#2b91af;">HttpListener</span>();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>listener.Prefixes.Add(<span style="color:#a31515;">&quot;http://*:8080/&quot;</span>);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>listener.Start();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">try</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:blue;">while</span> (<span style="color:blue;">true</span>)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;Listening&#8230;&quot;</span>);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:green;">// Note: The GetContext method blocks while waiting for a request. </span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:#2b91af;">HttpListenerContext</span> context = listener.GetContext();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:blue;">string</span> requestString = context.Request.RawUrl;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;Got request for &quot;</span> + requestString);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:#2b91af;">HttpWebRequest</span> request = (<span style="color:#2b91af;">HttpWebRequest</span>)<span style="color:#2b91af;">WebRequest</span>.Create(requestString);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span>request.KeepAlive = <span style="color:blue;">false</span>;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span>request.Proxy.Credentials = <span style="color:#2b91af;">CredentialCache</span>.DefaultCredentials;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span>request.Timeout = 200000;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:#2b91af;">RequestData</span> requestData = <span style="color:blue;">new</span> <span style="color:#2b91af;">RequestData</span>(request, context);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:#2b91af;">IAsyncResult</span> result = (<span style="color:#2b91af;">IAsyncResult</span>)request.BeginGetResponse(<span style="color:blue;">new</span> <span style="color:#2b91af;">AsyncCallback</span>(RespCallback), requestData);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> e)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;\nMain Exception raised!&quot;</span>);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;Source :&#123;0&#125; &quot;</span>, e.Source);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;Message :&#123;0&#125; &quot;</span>, e.Message);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>listener.Stop();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span><span style="color:blue;">static</span> <span style="color:blue;">void</span> RespCallback(<span style="color:#2b91af;">IAsyncResult</span> asynchronousResult)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">try</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:green;">// State of request is asynchronous.</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:#2b91af;">RequestData</span> requestData = (<span style="color:#2b91af;">RequestData</span>)asynchronousResult.AsyncState;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;Got back response from &quot;</span> + requestData.Context.Request.Url.AbsoluteUri);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:blue;">using</span>(<span style="color:#2b91af;">HttpWebResponse</span> response = (<span style="color:#2b91af;">HttpWebResponse</span>)requestData.WebRequest.EndGetResponse(asynchronousResult))</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:blue;">using</span> (<span style="color:#2b91af;">Stream</span> receiveStream = response.GetResponseStream())</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:#2b91af;">HttpListenerResponse</span> responseOut = requestData.Context.Response;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:green;">// Need to get the length of the response before it can be forwarded on</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span>responseOut.ContentLength64 = response.ContentLength;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:blue;">int</span> bytesCopied = CopyStream(receiveStream, responseOut.OutputStream);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span>responseOut.OutputStream.Close();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;Copied &#123;0&#125; bytes&quot;</span>, bytesCopied);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> e)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;\nMain Exception raised!&quot;</span>);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;Source :&#123;0&#125; &quot;</span>, e.Source);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&quot;Message :&#123;0&#125; &quot;</span>, e.Message);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span><span style="color:blue;">public</span> <span style="color:blue;">static</span> <span style="color:blue;">int</span> CopyStream(<span style="color:#2b91af;">Stream</span> input, <span style="color:#2b91af;">Stream</span> output)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">byte</span>[] buffer = <span style="color:blue;">new</span> <span style="color:blue;">byte</span>[32768];</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">int</span> bytesWritten = 0;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">while</span> (<span style="color:blue;">true</span>)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:blue;">int</span> read = input.Read(buffer, 0, buffer.Length);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:blue;">if</span> (read &lt;= 0)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:blue;">break</span>;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span>output.Write(buffer, 0, read);</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span>bytesWritten += read;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">return</span> bytesWritten;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;">&#125;</span></p>
<p> </p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=3&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2009/12/21/httplistener-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>
	</item>
		<item>
		<title>We went Sailing</title>
		<link>https://johnstewien.wordpress.com/2009/12/06/we-went-sailing/</link>
		<comments>https://johnstewien.wordpress.com/2009/12/06/we-went-sailing/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 11:13:33 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2009/12/06/we-went-sailing</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=12&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1232" class="bvMsg">
<p><a href="https://pankmq.blu.livefilestore.com/y1mGzGINIWztkd7urufSeoxOOS_EdxGafdk3p_F9jq6Ndfk19XVJ-3dEaxxIhxVNSkKrDu-PhEwqY8IKNcaYasPHO4ugemPhyC7qawx1RhcS3dJzznU_XHHtp6GABHblw9f90PCuhNjqMU4m6cDSEp46A/IMG_1982[4].jpg" rel="WLPP"><img border="0" src="https://pankmq.blu.livefilestore.com/y1ms2enVy52TNgDar-cSm4G6Cn2F6Ugmm9-fNiqHBw-BRdCzI3Exx6KPTy_r2bDZGj1I_4UkS--kkoUqsnuMMS0oiQ9R5uW_hJUo_xEVnLZ-BwRImqkJnJM57qBCRmBVBN3vxvqf-K_JWiNEjvaVWKSAA/IMG_1982_thumb[2].jpg" /></a></p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=12&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2009/12/06/we-went-sailing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>

		<media:content url="https://pankmq.blu.livefilestore.com/y1ms2enVy52TNgDar-cSm4G6Cn2F6Ugmm9-fNiqHBw-BRdCzI3Exx6KPTy_r2bDZGj1I_4UkS--kkoUqsnuMMS0oiQ9R5uW_hJUo_xEVnLZ-BwRImqkJnJM57qBCRmBVBN3vxvqf-K_JWiNEjvaVWKSAA/IMG_1982_thumb2.jpg" medium="image" />
	</item>
		<item>
		<title>fixed: error C2784 from compiling adding an entry to a std::map</title>
		<link>https://johnstewien.wordpress.com/2009/12/02/fixed-error-c2784-from-compiling-adding-an-entry-to-a-stdmap/</link>
		<comments>https://johnstewien.wordpress.com/2009/12/02/fixed-error-c2784-from-compiling-adding-an-entry-to-a-stdmap/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 10:21:08 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2009/12/02/fixed-error-c2784-from-compiling-adding-an-entry-to-a-stdmap</guid>
		<description><![CDATA[Got the above error, when compiling something that looked like this: std::map&#60;std::string, myType&#62; myMap;myMap[“Test”] = myType(); Looked around on the net, didn’t find the answer, thought about it for a bit and then realised I was missing #include &#60;string&#62; which &#8230; <a href="https://johnstewien.wordpress.com/2009/12/02/fixed-error-c2784-from-compiling-adding-an-entry-to-a-stdmap/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=7&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1225" class="bvMsg">
<p>Got the above error, when compiling something that looked like this:</p>
<p>std::map&lt;std::string, myType&gt; myMap;<br />myMap[“Test”] = myType();</p>
<p>Looked around on the net, didn’t find the answer, thought about it for a bit and then realised I was missing #include &lt;string&gt; which fixed the problem. The error was a bit cryptic. Look for yourself at this dump from the compiler output:</p>
<p> <span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::_Tree&lt;_Traits&gt; &amp;,const std::_Tree&lt;_Traits&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::_Tree&lt;_Traits&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(1372) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(142) : while compiling class template member function &#8216;bool std::less&lt;_Ty&gt;::operator ()(const _Ty &amp;,const _Ty &amp;) const&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>with</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>[</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Ty=std::string</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\map(72) : see reference to class template instantiation &#8216;std::less&lt;_Ty&gt;&#8217; being compiled</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>with</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>[</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Ty=std::string</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(26) : see reference to class template instantiation &#8216;std::_Tmap_traits&lt;_Kty,_Ty,_Pr,_Alloc,_Mfl&gt;&#8217; being compiled</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>with</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>[</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Kty=std::string,</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Ty=std::string,</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Pr=std::less&lt;std::string&gt;,</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Alloc=std::allocator&lt;std::pair&lt;const std::string,std::string&gt;&gt;,</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>       </span><span>     </span>_Mfl=false</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(68) : see reference to class template instantiation &#8216;std::_Tree_nod&lt;_Traits&gt;&#8217; being compiled</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>with</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>[</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Traits=std::_Tmap_traits&lt;std::string,std::string,std::less&lt;std::string&gt;,std::allocator&lt;std::pair&lt;const std::string,std::string&gt;&gt;,false&gt;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(94) : see reference to class template instantiation &#8216;std::_Tree_ptr&lt;_Traits&gt;&#8217; being compiled</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>with</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>[</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Traits=std::_Tmap_traits&lt;std::string,std::string,std::less&lt;std::string&gt;,std::allocator&lt;std::pair&lt;const std::string,std::string&gt;&gt;,false&gt;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(112) : see reference to class template instantiation &#8216;std::_Tree_val&lt;_Traits&gt;&#8217; being compiled</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>with</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>[</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Traits=std::_Tmap_traits&lt;std::string,std::string,std::less&lt;std::string&gt;,std::allocator&lt;std::pair&lt;const std::string,std::string&gt;&gt;,false&gt;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\map(82) : see reference to class template instantiation &#8216;std::_Tree&lt;_Traits&gt;&#8217; being compiled</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>with</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>[</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Traits=std::_Tmap_traits&lt;std::string,std::string,std::less&lt;std::string&gt;,std::allocator&lt;std::pair&lt;const std::string,std::string&gt;&gt;,false&gt;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>c:\projects\flewse\source\x-planeflewse\VisualSettings.h(16) : see reference to class template instantiation &#8216;std::map&lt;_Kty,_Ty&gt;&#8217; being compiled</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>with</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>[</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Kty=std::string,</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>            </span>_Ty=std::string</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::_Tree&lt;_Traits&gt; &amp;,const std::_Tree&lt;_Traits&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::_Tree&lt;_Traits&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(1372) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::_Tree&lt;_Traits&gt; &amp;,const std::_Tree&lt;_Traits&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::_Tree&lt;_Traits&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(1372) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::_Tree&lt;_Traits&gt; &amp;,const std::_Tree&lt;_Traits&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::_Tree&lt;_Traits&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(1372) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::vector&lt;_Ty,_Alloc&gt; &amp;,const std::vector&lt;_Ty,_Alloc&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::vector&lt;_Ty,_Alloc&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\vector(1276) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::vector&lt;_Ty,_Alloc&gt; &amp;,const std::vector&lt;_Ty,_Alloc&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::vector&lt;_Ty,_Alloc&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\vector(1276) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::vector&lt;_Ty,_Alloc&gt; &amp;,const std::vector&lt;_Ty,_Alloc&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::vector&lt;_Ty,_Alloc&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\vector(1276) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::vector&lt;_Ty,_Alloc&gt; &amp;,const std::vector&lt;_Ty,_Alloc&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::vector&lt;_Ty,_Alloc&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\vector(1276) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::reverse_iterator&lt;_RanIt&gt; &amp;,const std::reverse_iterator&lt;_RanIt2&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::reverse_iterator&lt;_RanIt&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1880) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::reverse_iterator&lt;_RanIt&gt; &amp;,const std::reverse_iterator&lt;_RanIt2&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::reverse_iterator&lt;_RanIt&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1880) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::reverse_iterator&lt;_RanIt&gt; &amp;,const std::reverse_iterator&lt;_RanIt2&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::reverse_iterator&lt;_RanIt&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1880) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::reverse_iterator&lt;_RanIt&gt; &amp;,const std::reverse_iterator&lt;_RanIt2&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::reverse_iterator&lt;_RanIt&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1880) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::pair&lt;_Ty1,_Ty2&gt; &amp;,const std::pair&lt;_Ty1,_Ty2&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::pair&lt;_Ty1,_Ty2&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\utility(76) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::pair&lt;_Ty1,_Ty2&gt; &amp;,const std::pair&lt;_Ty1,_Ty2&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::pair&lt;_Ty1,_Ty2&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\utility(76) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::pair&lt;_Ty1,_Ty2&gt; &amp;,const std::pair&lt;_Ty1,_Ty2&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::pair&lt;_Ty1,_Ty2&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\utility(76) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2784: &#8216;bool std::operator &lt;(const std::pair&lt;_Ty1,_Ty2&gt; &amp;,const std::pair&lt;_Ty1,_Ty2&gt; &amp;)&#8217; : could not deduce template argument for &#8216;const std::pair&lt;_Ty1,_Ty2&gt; &amp;&#8217; from &#8216;const std::string&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;<span>        </span>C:\Program Files\Microsoft Visual Studio 8\VC\include\utility(76) : see declaration of &#8216;std::operator &lt;&#8217;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:8pt;">1&gt;C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(143) : error C2676: binary &#8216;&lt;&#8217; : &#8216;const std::string&#8217; does not define this operator or a conversion to a type acceptable to the predefined operator</span></p>
<p> </p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=7&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2009/12/02/fixed-error-c2784-from-compiling-adding-an-entry-to-a-stdmap/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>
	</item>
		<item>
		<title>Handling all mouse movements at the Main Form level in C#</title>
		<link>https://johnstewien.wordpress.com/2009/11/21/handling-all-mouse-movements-at-the-main-form-level-in-c/</link>
		<comments>https://johnstewien.wordpress.com/2009/11/21/handling-all-mouse-movements-at-the-main-form-level-in-c/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 12:30:42 +0000</pubDate>
		<dc:creator>johnstewien</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnstewien.wordpress.com/2009/11/21/handling-all-mouse-movements-at-the-main-form-level-in-c</guid>
		<description><![CDATA[In a C# WinForms application, mouse movement events always go to the child control that the mouse moves over. Sometimes you might want to track mouse movements at the Form level instead of handling them at the child control level. &#8230; <a href="https://johnstewien.wordpress.com/2009/11/21/handling-all-mouse-movements-at-the-main-form-level-in-c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=13&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="msgcns!E6885DB5CEBABBC8!1217" class="bvMsg">
<p>In a C# WinForms application, mouse movement events always go to the child control that the mouse moves over. Sometimes you might want to track mouse movements at the Form level instead of handling them at the child control level. To do this you need to handle the raw windows messages at the application level. Here’s the source code for doing this:</p>
<p><span style="font-family:'Courier New';font-size:10pt;"><span>      </span><span style="color:blue;">public</span> <span style="color:blue;">partial</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">MainForm</span> : <span style="color:#2b91af;">Form</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>      </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>[<span style="color:#2b91af;">SecurityPermission</span>(<span style="color:#2b91af;">SecurityAction</span>.LinkDemand, Flags = <span style="color:#2b91af;">SecurityPermissionFlag</span>.UnmanagedCode)]</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span><span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">TestMessageFilter</span> : <span style="color:#2b91af;">IMessageFilter</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">const</span> <span style="color:blue;">int</span> WM_MOUSEMOVE = 0&#215;200;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">static</span> <span style="color:blue;">int</span> count = 0;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:blue;">public</span> <span style="color:blue;">bool</span> PreFilterMessage(<span style="color:blue;">ref</span> <span style="color:#2b91af;">Message</span> m)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:green;">// Blocks all the messages relating to the left mouse button.</span></span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:blue;">if</span> (m.Msg == WM_MOUSEMOVE)</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span>System.Diagnostics.<span style="color:#2b91af;">Trace</span>.WriteLine(<span style="color:#a31515;">&quot;Mouse Moved &quot;</span> + (++count).ToString());</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                              </span><span style="color:blue;">return</span> <span style="color:blue;">true</span>;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                        </span><span style="color:blue;">return</span> <span style="color:blue;">false</span>;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#125;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span><span style="color:blue;">public</span> MainForm()</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#123;</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span>InitializeComponent();</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>                  </span><span style="color:#2b91af;">Application</span>.AddMessageFilter(<span style="color:blue;">new</span> <span style="color:#2b91af;">TestMessageFilter</span>());</span></p>
<p style="line-height:normal;margin-bottom:0;"><span style="font-family:'Courier New';font-size:10pt;"><span>            </span>&#125;</span></p>
<p> </p>
<p>The WM_MOUSEMOVE constant is from C/C++ programming and is part of the Win32 API. It’s declared in Winuser.h which can be found in the Windows SDK if you have Visual C++ installed.</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnstewien.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnstewien.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnstewien.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnstewien.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnstewien.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnstewien.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnstewien.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnstewien.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnstewien.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnstewien.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnstewien.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnstewien.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnstewien.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnstewien.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnstewien.wordpress.com&amp;blog=17010616&amp;post=13&amp;subd=johnstewien&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://johnstewien.wordpress.com/2009/11/21/handling-all-mouse-movements-at-the-main-form-level-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/4bf99c4966907b2540ba34be01a8dbcb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnstewien</media:title>
		</media:content>
	</item>
	</channel>
</rss>
