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

<channel>
	<title>Furo&#039;s World &#187; C#</title>
	<atom:link href="http://www.furo.fr/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.furo.fr</link>
	<description>Welcome to my piece of web!</description>
	<lastBuildDate>Fri, 15 Jul 2011 08:59:33 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>&#8220;Cannot obtain value of local or argument&#8221; &#8220;as it is not available at this instruction pointer, possibly because it has been optimized away.&#8221;</title>
		<link>http://www.furo.fr/2008/05/08/cannot-obtain-value-of-local-or-argument-as-it-is-not-available-at-this-instruction-pointer-possibly-because-it-has-been-optimized-away/</link>
		<comments>http://www.furo.fr/2008/05/08/cannot-obtain-value-of-local-or-argument-as-it-is-not-available-at-this-instruction-pointer-possibly-because-it-has-been-optimized-away/#comments</comments>
		<pubDate>Thu, 08 May 2008 17:27:16 +0000</pubDate>
		<dc:creator>Flotueur</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[exception]]></category>

		<guid isPermaLink="false">http://www.furo.fr/?p=24</guid>
		<description><![CDATA[Welcome in the weird world of C#! Sometimes you say: &#8220;Programming is simply, if you know how things work then you can debug or fix every problems!&#8221;. But when something not understandable happens, well&#8230; you just have your eyes to cry! In my case I was doing a small part of code, following a tutorial. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-18 alignleft" style="margin: 10px; float: left;" title="Logo .NET" src="http://www.furo.fr/wp-content/200px-visual_basic_net_logo1.jpg" alt="" width="141" height="76" />Welcome in the weird world of <strong>C#</strong>! Sometimes you say: &#8220;Programming is simply, if you know <strong>how things work</strong> then you can debug or fix every problems!&#8221;. But when something <strong>not understandable</strong> happens, well&#8230; you just have your eyes to cry!</p>
<p>In my case I was doing a small part of code, following a tutorial. Everything was crystal clear. But at the execution, this error happened:</p>
<blockquote><p><strong><code>Cannot obtain value of local or argument XXXXX as it is not available at this instruction pointer, possibly because it has been optimized away.</code></strong></p></blockquote>
<p>So I began to search, and it was honestly the first time that the Microsoft search engine gave me <strong>more answer</strong> than Google! And what a surprise when I discovered that all the occurrence found were people that had this problem and that the problem was <strong>completely different from mine</strong>. Going further, I discovered that in the most cases, having this exception is <strong>a known problem of the framework</strong>: I couldn&#8217;t do nothing about it.</p>
<p>So basicaly, it is a <strong>weakness in the .NET 2.0 framework</strong>. Don&#8217;t ask me more, people from who i got the intell didn&#8217;t knew much more. but since my speciality is to be stubborn I tried a few things and found something that could interest you if you are in the same case.</p>
<p>In fact, when you execute the line of code that returns this exception, <strong>it is like </strong>it is executed 2 times so a solution is to surround your code by this:</p>
<blockquote><p><code>Try{<br />
Your_expression;<br />
}<br />
catch{Exception}</code></p></blockquote>
<p>Your expression will be evaluated and will return the exception but with no effect. Ok, it is <strong>quick and dirty</strong> but it works, and can help you if like me, you don&#8217;t have a choice.</p>
<p>If you have any feedback about that issue, <strong>please leave a comment</strong>!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.furo.fr/2008/05/08/cannot-obtain-value-of-local-or-argument-as-it-is-not-available-at-this-instruction-pointer-possibly-because-it-has-been-optimized-away/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ContextMenu and TreeView in C#</title>
		<link>http://www.furo.fr/2008/03/28/contextmenu-and-treeview-in-c/</link>
		<comments>http://www.furo.fr/2008/03/28/contextmenu-and-treeview-in-c/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 17:51:31 +0000</pubDate>
		<dc:creator>Flotueur</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[contextMenu]]></category>
		<category><![CDATA[TreeView]]></category>

		<guid isPermaLink="false">http://www.furo.fr/2008/03/28/contextmenu-and-treeview-in-c/</guid>
		<description><![CDATA[Since a lot of time, I had a problem with the ContextMenuStrip on my application: when a user did a right-click on a node in one of my tree without having selected with left-click first, the node meant to be selected was not! To fix that, just add this code on your tree &#8220;treeView1&#8243; when [...]]]></description>
			<content:encoded><![CDATA[<p align="left"><img src="http://www.furo.fr/wp-content/200px-visual_basic_net_logo1.thumbnail.jpg" alt="Logo .NET" align="left" hspace="10" vspace="10" />Since a lot of time, I had a problem with the <strong>ContextMenuStrip </strong>on my application: when a user did a <strong>right-click</strong> on a node in one of my tree <strong>without having selected with left-click first</strong>, the node meant to be selected <strong>was not</strong>!</p>
<p>To fix that, just <strong>add this code</strong> on your tree &#8220;treeView1&#8243; when the <strong>event </strong>&#8220;MouseDown&#8221; occurs:</p>
<blockquote><p><code>private void treeView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
TreeNode tn = treeView1.GetNodeAt(e.X, e.Y);<br />
treeView1.SelectedNode = tn;<br />
}</code></p></blockquote>
<p>Troubles are finished for my customers! (and by extension for me as well <img src='http://www.furo.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
]]></content:encoded>
			<wfw:commentRss>http://www.furo.fr/2008/03/28/contextmenu-and-treeview-in-c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

