<?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>Rant in C#</title>
	<atom:link href="http://rantincsharp.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rantincsharp.wordpress.com</link>
	<description>...a site about programming and GIS</description>
	<lastBuildDate>Mon, 05 Dec 2011 11:37:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rantincsharp.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Rant in C#</title>
		<link>http://rantincsharp.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rantincsharp.wordpress.com/osd.xml" title="Rant in C#" />
	<atom:link rel='hub' href='http://rantincsharp.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Convert Latitude Longitude to Easting Northings</title>
		<link>http://rantincsharp.wordpress.com/2011/08/31/convert-latitude-longitude-to-easting-northings/</link>
		<comments>http://rantincsharp.wordpress.com/2011/08/31/convert-latitude-longitude-to-easting-northings/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 10:25:40 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[british-national-grid]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[easting]]></category>
		<category><![CDATA[latitude]]></category>
		<category><![CDATA[longitude]]></category>
		<category><![CDATA[northing]]></category>
		<category><![CDATA[ordnance-survey]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=232</guid>
		<description><![CDATA[Take a look and hopefully it works in your code.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=232&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Take a look and hopefully it works in your code.</p>
<p><pre class="brush: csharp;">

private double toRad(double val)
{
	return val * (Math.PI / 180);
}
        
public void LatLongToEastNorth(double latitude, double longitude)
{
       //This will not work unless you have your lats and longs in decimal degrees.
       latitude = toRad(latitude);
       longitude = toRad(longitude);

       double a = 6377563.396, b = 6356256.910; // Airy 1830 major &amp;amp; minor semi-axes
       //double a = 6378137.0, b = 6356752.314245; WGS84 major &amp;amp; minor semi-axes

       double F0 = 0.9996012717; // NatGrid scale factor on central meridian
       double lat0 = toRad(49);
       double lon0 = toRad(-2); // NatGrid true origin
       double N0 = -100000, E0 = 400000; // northing &amp;amp; easting of true origin, metres
       double e2 = 1 - (b * b) / (a * a); // eccentricity squared
       double n = (a - b) / (a + b), n2 = n * n, n3 = n * n * n;

       double cosLat = Math.Cos(latitude), sinLat = Math.Sin(latitude);
       double nu = a * F0 / Math.Sqrt(1 - e2 * sinLat * sinLat) ; // transverse radius of curvature
       double rho = a * F0 * (1 - e2) / Math.Pow(1 - e2 * sinLat * sinLat, 1.5); // meridional radius of curvature
   
       double eta2 = nu / rho - 1;

       double Ma = (1 + n + (5 / 4) * n2 + (5 / 4) * n3) * (latitude - lat0);
       double Mb = (3 * n + 3 * n * n + (21/8)*n3) * Math.Sin(latitude - lat0) * Math.Cos(latitude + lat0);
       double Mc = ((15/8)*n2 + (15/8)*n3) * Math.Sin(2 * (latitude - lat0)) * Math.Cos(2 * (latitude + lat0));
       double Md = (35 / 24) * n3 * Math.Sin(3 * (latitude - lat0)) * Math.Cos(3 * (latitude + lat0));
       double M = b * F0 * (Ma - Mb + Mc - Md); // meridional arc

       double cos3lat = cosLat * cosLat * cosLat;
       double cos5lat = cos3lat * cosLat * cosLat;
       double tan2lat = Math.Tan(latitude) * Math.Tan(latitude);
       double tan4lat = tan2lat * tan2lat;

       double I = M + N0;
       double II = (nu / 2) * sinLat * cosLat;
       double III = (nu / 24) * sinLat * cos3lat * (5 - tan2lat + 9 * eta2);
       double IIIA = (nu / 720) * sinLat * cos5lat * (61 - 58 * tan2lat + tan4lat);
       double IV = nu * cosLat;
       double V = (nu / 6) * cos3lat * (nu / rho - tan2lat);
       double VI = (nu / 120) * cos5lat * (5 - 18 * tan2lat + tan4lat + 14 * eta2 - 58 * tan2lat * eta2);

       double dLon = longitude - lon0;
       double dLon2 = dLon * dLon, dLon3 = dLon2 * dLon, dLon4 = dLon3 * dLon, dLon5 = dLon4 * dLon, dLon6 = dLon5 * dLon;

       double N = I + II * dLon2 + III * dLon4 + IIIA * dLon6; //This is the northing
       double E = E0 + IV * dLon + V * dLon3 + VI * dLon5; //This is the easting  
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/232/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=232&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2011/08/31/convert-latitude-longitude-to-easting-northings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>ArcGIS Compatibility Matrix with Visual Studio</title>
		<link>http://rantincsharp.wordpress.com/2011/07/14/arcgis-compatibility-matrix-with-visual-studio/</link>
		<comments>http://rantincsharp.wordpress.com/2011/07/14/arcgis-compatibility-matrix-with-visual-studio/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 09:32:05 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=224</guid>
		<description><![CDATA[I thought this was a useful matrix (taken from ESRI Austrailia) &#8211; god knows why this isn&#8217;t so readily available from ESRI Inc or UK. It&#8217;s pretty important stuff for GIS Developers.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=224&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I thought this was a useful matrix (taken from ESRI Austrailia) &#8211; god knows why this isn&#8217;t so readily available from ESRI Inc or UK.  It&#8217;s pretty important stuff for GIS Developers.</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/07/arcgis-visual-studio-matrix.png"><img src="http://rantincsharp.files.wordpress.com/2011/07/arcgis-visual-studio-matrix.png?w=590&#038;h=471" alt="" title="ArcGIS Visual Studio Matrix" width="590" height="471" class="aligncenter size-full wp-image-225" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/224/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=224&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2011/07/14/arcgis-compatibility-matrix-with-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/07/arcgis-visual-studio-matrix.png" medium="image">
			<media:title type="html">ArcGIS Visual Studio Matrix</media:title>
		</media:content>
	</item>
		<item>
		<title>How to query ArcIMS services with ArcObjects</title>
		<link>http://rantincsharp.wordpress.com/2011/06/24/how-to-query-arcims-services-with-arcobjects/</link>
		<comments>http://rantincsharp.wordpress.com/2011/06/24/how-to-query-arcims-services-with-arcobjects/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 12:15:34 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[arcobjects]]></category>
		<category><![CDATA[ims]]></category>
		<category><![CDATA[services]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=215</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=215&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
IIMSServiceDescription imsServiceDescription = new IMSServiceNameClass();
imsServiceDescription.URL = @&quot;you server here&quot;;                 
imsServiceDescription.Name = &quot;catalog&quot;;

IIMSAxlRequest axlRequest = (IIMSAxlRequest)imsServiceDescription;
String result = axlRequest.SendAxlRequest(&quot;&lt;GETCLIENTSERVICES/&gt;&quot;, false, null, false, true);

IXmlPropertySet2 xmlProps = new XmlPropertySetClass();
xmlProps.SetXml(result);
object val = new object();
xmlProps.GetAttribute(&quot;RESPONSE/SERVICES/SERVICE&quot;, &quot;NAME&quot;, out val);

object[] vals = (object[]) val;

for (int i = 0; i &amp;lt; vals.Length; i++)
{
     Debug.WriteLine(vals[i].ToString());
}</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/215/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=215&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2011/06/24/how-to-query-arcims-services-with-arcobjects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Of course Click Once isn&#8217;t perfect!</title>
		<link>http://rantincsharp.wordpress.com/2011/05/10/of-course-click-once-isnt-perfect/</link>
		<comments>http://rantincsharp.wordpress.com/2011/05/10/of-course-click-once-isnt-perfect/#comments</comments>
		<pubDate>Tue, 10 May 2011 14:41:24 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[click-once]]></category>
		<category><![CDATA[deployment]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=207</guid>
		<description><![CDATA[Bit annoyed with Click Once &#8211; I wanted to take it to the next level to have Test and Production versions. This happens to be a non-trivial task. Great! See the following link from Code Magazine.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=207&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Bit annoyed with Click Once &#8211; I wanted to take it to the next level to have Test and Production versions.  This happens to be a non-trivial task.  Great!  See the following link from <a href="http://www.code-magazine.com/Article.aspx?quickid=0902031">Code Magazine</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/207/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=207&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2011/05/10/of-course-click-once-isnt-perfect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Subversion on Windows (Client and Server)</title>
		<link>http://rantincsharp.wordpress.com/2011/03/10/installing-subversion-on-windows-client-and-server/</link>
		<comments>http://rantincsharp.wordpress.com/2011/03/10/installing-subversion-on-windows-client-and-server/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 15:53:28 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[back-up]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[collabnet]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[subclipse]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[walkthrough]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=178</guid>
		<description><![CDATA[Ok this was painful, so in order to save you some time (and pain) here&#8217;s a fairly straight forward step by step guide to get subversion up and running.  It&#8217;s only a basic install and doesn&#8217;t go into massive detail but should be just enought to get you started. Just to give you an idea of envionments here and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=178&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://rantincsharp.files.wordpress.com/2011/03/add-new-svn-repository.jpg"></a>Ok this was painful, so in order to save you some time (and pain) here&#8217;s a fairly straight forward step by step guide to get subversion up and running.  It&#8217;s only a basic install and doesn&#8217;t go into massive detail but should be just enought to get you started.</p>
<p>Just to give you an idea of envionments here and software used:</p>
<ul>
<li>2 PCs on the same domain, a dev PC and another PC acting as a server (used this just for testing but would be much the same process on Windows Server X).</li>
<li>Both PCs running Windows XP SP3.</li>
<li>Eclipse 3.3.2 (Europa).</li>
<li>Client side subversion Subclipse from <a href="http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA" target="_blank">Tigris.org</a> and at the time of writing v1.6.17.  This is compatible with old and new versions of Eclipse (except Helios I think).  It will work with Europa, Callisto, Ganymede and Galileo.</li>
<li>Server side (also includes a client too but don&#8217;t worry about this) is from CollabNet &#8211; <a href="http://www.collab.net/downloads/subversion/svn1.5.html" target="_blank">Subversion Server and Client v1.6.16</a> - click the download button &#8211; you may have to create an account with them, but it&#8217;s all free.</li>
</ul>
<p> </p>
<h2>Client Install</h2>
<p>1. In Eclipse go to <strong>Find and Install</strong></p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/find-and-install.jpg"><img class="aligncenter size-medium wp-image-179" title="Find and Install" src="http://rantincsharp.files.wordpress.com/2011/03/find-and-install.jpg?w=300&#038;h=185" alt="" width="300" height="185" /></a></p>
<p>2. Edit remote site like so:</p>
<p><img class="aligncenter size-medium wp-image-180" title="Edit Remote SIte" src="http://rantincsharp.files.wordpress.com/2011/03/edit-remote-site.jpg?w=300&#038;h=129" alt="" width="300" height="129" /></p>
<p>You need to paste in the link URL:    http://subclipse.tigris.org/update_1.6.x</p>
<p>3. Select Subclipse as sites to update from and click <strong>Finish</strong>.</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/install-subclipse.jpg"><img class="aligncenter size-medium wp-image-182" title="Install Subclipse" src="http://rantincsharp.files.wordpress.com/2011/03/install-subclipse.jpg?w=259&#038;h=300" alt="" width="259" height="300" /></a></p>
<p>4.  If you are using Europa version of Eclipse you may also have to install Mylyn 3.0 before you can install Subclipse.</p>
<h2>Server Install</h2>
<p>This is just a PC with an IP address of 10.9.65.154.</p>
<p>1.  Download the Collabnet software as described above and double click the exe file to install.  You will see a screen like below &#8211; press <strong>Next</strong>.</p>
<p style="text-align:center;"><img class="aligncenter size-medium wp-image-183" style="border:black 1px solid;" title="collab1" src="http://rantincsharp.files.wordpress.com/2011/03/collab1.jpg?w=300&#038;h=231" alt="" width="300" height="231" /></p>
<p>2.  Skip past the <strong>View Latest Readme </strong>screen and Choose Components like below and press <strong>Next</strong>:</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/collab2.jpg"><img class="aligncenter size-medium wp-image-184" title="collab2" src="http://rantincsharp.files.wordpress.com/2011/03/collab2.jpg?w=300&#038;h=232" alt="" width="300" height="232" /></a></p>
<p>3. For <strong>svnserve Configuration</strong> I tend to change the <strong>Repository Path</strong> to something shorter like <strong>C:\svn, </strong>press <strong>Next:</strong></p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/collab31.jpg"><img class="aligncenter size-medium wp-image-186" title="collab3" src="http://rantincsharp.files.wordpress.com/2011/03/collab31.jpg?w=300&#038;h=230" alt="" width="300" height="230" /></a></p>
<p>4. For <strong>Apache Configuration</strong>, again change the Repository path to the shorter <strong>C:\svn, </strong>press <strong>Next</strong>.</p>
<p><img class="aligncenter size-medium wp-image-187" title="collab4" src="http://rantincsharp.files.wordpress.com/2011/03/collab4.jpg?w=300&#038;h=232" alt="" width="300" height="232" /></p>
<p>5. At the <strong>Choose Install Location </strong>for the Subversion Server, install at the default location, press <strong>Next</strong>:</p>
<p><img class="aligncenter size-medium wp-image-188" title="collab5" src="http://rantincsharp.files.wordpress.com/2011/03/collab5.jpg?w=300&#038;h=231" alt="" width="300" height="231" /></p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/collab5.jpg"></a>6.  The next screen is for <strong>Automatic Updates Configuration</strong> where you can choose to <strong>Enable update notifications for this Collabnet product </strong>and enter details if you are behind a proxy server:</p>
<p> <a href="http://rantincsharp.files.wordpress.com/2011/03/collab6.jpg"><img class="aligncenter size-medium wp-image-189" title="collab6" src="http://rantincsharp.files.wordpress.com/2011/03/collab6.jpg?w=300&#038;h=231" alt="" width="300" height="231" /></a></p>
<p>7. The install will complete and finish with the following screen.  Click finish on the last screen:</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/collab7.jpg"><img class="aligncenter size-medium wp-image-190" title="collab7" src="http://rantincsharp.files.wordpress.com/2011/03/collab7.jpg?w=300&#038;h=232" alt="" width="300" height="232" /></a></p>
<p>8. Start the CollabNet Subversion svnserve service in Services:</p>
<p><img class="aligncenter size-medium wp-image-191" title="collab8" src="http://rantincsharp.files.wordpress.com/2011/03/collab8.jpg?w=300&#038;h=177" alt="" width="300" height="177" /></p>
<p>9.  Then configure Collabnet Subversion Apache to run as Administrator to the local machine by right clicking, selecting <strong>Properties </strong>on the service.  Choose the radio button <strong>This account</strong> and edit the dialog like below, press <strong>OK</strong>, the start the service:</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/collab9.jpg"><img class="aligncenter size-medium wp-image-192" title="collab9" src="http://rantincsharp.files.wordpress.com/2011/03/collab9.jpg?w=293&#038;h=300" alt="" width="293" height="300" /></a></p>
<h2>Create your first repository</h2>
<p>1.  Open a command window and create your first repository by typing </p>
<p><pre class="brush: plain;">
svnadmin create &quot;C:\svn\repository&quot;
</pre></p>
<p>2.  Navigate to that newly created directory and edit file <strong>svnserve.conf</strong> in conf folder.  Remove hash sign (#) <span style="color:#ff0000;"><strong>with no leading spaces </strong></span>to the following:</p>
<p><pre class="brush: plain;">
anon-access = read
auth-access = write
password-db = passwd
</pre></p>
<p>Save the file and close.</p>
<p>3.  Open and edit file <strong>passwd</strong>.  Again, delete hash sign and add some users of your own if you like (&lt;username&gt; = &lt;password&gt;):</p>
<p><pre class="brush: plain;">
harry = harryssecret
sally = sallyssecret
simonearnshaw = wibble
</pre></p>
<p>4.  You can get really fancy and elaborate with users, groups and security.  I&#8217;ll leave that up to you, this configuration will just get you started.</p>
<p>5.  As subversion server operates on <strong>TCP port 3690</strong> &#8211; you need to add this as an <strong>exception to the firewall</strong>.</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/collab10.jpg"><img class="aligncenter size-medium wp-image-195" title="collab10" src="http://rantincsharp.files.wordpress.com/2011/03/collab10.jpg?w=300&#038;h=216" alt="" width="300" height="216" /></a></p>
<h2>Checking in your first project to Subversion from Eclipse</h2>
<p>1. Go back to your dev PC, essentially the client.  Open Eclipse and make sure you are in SVN Repository Perspective.</p>
<p><img class="aligncenter size-medium wp-image-196" title="Open SVN Perspective" src="http://rantincsharp.files.wordpress.com/2011/03/open-svn-perspective.jpg?w=246&#038;h=300" alt="" width="246" height="300" /></p>
<p>2.  Now add a new SVN Repository to the view.  This relates to the command we issued on the server to create our first repository.  The protocol is svn://, and is followed by the servname or IP address.</p>
<p><img class="aligncenter" title="Add new svn repository" src="http://rantincsharp.files.wordpress.com/2011/03/add-new-svn-repository.jpg?w=300&#038;h=284" alt="" width="300" height="284" /></p>
<p>3.  Go to your Java EE or Java persepective and right click one of your projects.  Select <strong>Team </strong>-&gt; <strong>Share Project -&gt; SVN -&gt; Next</strong>.</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/share-project.jpg"><img class="aligncenter size-medium wp-image-199" title="Share Project" src="http://rantincsharp.files.wordpress.com/2011/03/share-project.jpg?w=300&#038;h=270" alt="" width="300" height="270" /></a></p>
<p>4.  The next screen is <strong>Share Project with SVN Repository</strong>.  As we have already made a repository then we can select <strong>Use existing repository location</strong>:</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/share-project-with-svn-repository.jpg"><img class="aligncenter size-medium wp-image-200" title="Share Project with SVN Repository" src="http://rantincsharp.files.wordpress.com/2011/03/share-project-with-svn-repository.jpg?w=300&#038;h=270" alt="" width="300" height="270" /></a></p>
<p>5.   Leave the default, Use project name a folder name:</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/enter-folder-name.jpg"><img class="aligncenter size-medium wp-image-201" title="Enter Folder Name" src="http://rantincsharp.files.wordpress.com/2011/03/enter-folder-name.jpg?w=300&#038;h=270" alt="" width="300" height="270" /></a></p>
<p>6.  At this point you should add comments &#8211; the comment &#8220;Initial import&#8221; is inserted as default, this is OK for our purpose so just press Finish.</p>
<p><a href="http://rantincsharp.files.wordpress.com/2011/03/ready-to-share-project.jpg"><img class="aligncenter size-medium wp-image-202" title="Ready to Share Project" src="http://rantincsharp.files.wordpress.com/2011/03/ready-to-share-project.jpg?w=300&#038;h=270" alt="" width="300" height="270" /></a></p>
<p>7.  At this point you will be asked for your security credentials that you set up earlier in the Server section.</p>
<p>And that&#8217;s it you&#8217;re finished.  I hope you found this informative and useful. </p>
<a href="http://polldaddy.com/poll/4694393/">View This Poll</a>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/178/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=178&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2011/03/10/installing-subversion-on-windows-client-and-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/find-and-install.jpg?w=300" medium="image">
			<media:title type="html">Find and Install</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/edit-remote-site.jpg?w=300" medium="image">
			<media:title type="html">Edit Remote SIte</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/install-subclipse.jpg?w=259" medium="image">
			<media:title type="html">Install Subclipse</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab1.jpg?w=300" medium="image">
			<media:title type="html">collab1</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab2.jpg?w=300" medium="image">
			<media:title type="html">collab2</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab31.jpg?w=300" medium="image">
			<media:title type="html">collab3</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab4.jpg?w=300" medium="image">
			<media:title type="html">collab4</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab5.jpg?w=300" medium="image">
			<media:title type="html">collab5</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab6.jpg?w=300" medium="image">
			<media:title type="html">collab6</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab7.jpg?w=300" medium="image">
			<media:title type="html">collab7</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab8.jpg?w=300" medium="image">
			<media:title type="html">collab8</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab9.jpg?w=293" medium="image">
			<media:title type="html">collab9</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/collab10.jpg?w=300" medium="image">
			<media:title type="html">collab10</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/open-svn-perspective.jpg?w=246" medium="image">
			<media:title type="html">Open SVN Perspective</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/add-new-svn-repository.jpg?w=300" medium="image">
			<media:title type="html">Add new svn repository</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/share-project.jpg?w=300" medium="image">
			<media:title type="html">Share Project</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/share-project-with-svn-repository.jpg?w=300" medium="image">
			<media:title type="html">Share Project with SVN Repository</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/enter-folder-name.jpg?w=300" medium="image">
			<media:title type="html">Enter Folder Name</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2011/03/ready-to-share-project.jpg?w=300" medium="image">
			<media:title type="html">Ready to Share Project</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Show Click Once version in form title text</title>
		<link>http://rantincsharp.wordpress.com/2011/02/25/how-to-show-click-once-version-in-form-title-text/</link>
		<comments>http://rantincsharp.wordpress.com/2011/02/25/how-to-show-click-once-version-in-form-title-text/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 16:27:25 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[clickonce]]></category>
		<category><![CDATA[deployment]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=169</guid>
		<description><![CDATA[I think it&#8217;s handy to show the version of your software sometimes in the title text of your form to make sure you can see at a glance that the click once distro is the same as the program that is currently running on a PC. In order to achieve this do the following: Make [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=169&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I think it&#8217;s handy to show the version of your software sometimes in the title text of your form to make sure you can see at a glance that the click once distro is the same as the program that is currently running on a PC. In order to achieve this do the following:</p>
<p>Make sure <strong>add a reference</strong> in your project to System.Deployment as well as the including the using statement.  You need this in order to access some specific libraries in this assembley.</p>
<p>In your initialisation of your form you should check to see that the version running has been deployed by Click Once.  This means that debug versions of this won&#8217;t work but live deployed versions will &#8211; if you don&#8217;t do this you will get an exception.</p>
<p>See code below:</p>
<p><pre class="brush: csharp;">
           if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                    this.Text = String.Format(&quot;My Foo Program {0}&quot;,
                    System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion);
            }
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/169/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=169&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2011/02/25/how-to-show-click-once-version-in-form-title-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Issues with persisting changes to the scale in PageLayout (LayoutView) using ArcObjects</title>
		<link>http://rantincsharp.wordpress.com/2010/10/29/issues-with-persisting-changes-to-the-scale-in-pagelayout-layoutview-using-arcobjects/</link>
		<comments>http://rantincsharp.wordpress.com/2010/10/29/issues-with-persisting-changes-to-the-scale-in-pagelayout-layoutview-using-arcobjects/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 20:02:28 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[arcmap]]></category>
		<category><![CDATA[arcobjects]]></category>
		<category><![CDATA[pagelayout]]></category>
		<category><![CDATA[scale]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=148</guid>
		<description><![CDATA[Scenario Now and again you may find yourself developing an application outside of ArcMap i.e. essentially an ArcEngine app. I was developing an application that accessed an mxd via the IMapDocument interface and tried to persist a change in the map scale in the Layout View.  Every time I changed the scale and saved the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=148&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Scenario</strong></p>
<p>Now and again you may find yourself developing an application outside of ArcMap i.e. essentially an ArcEngine app.</p>
<p>I was developing an application that accessed an mxd via the IMapDocument interface and tried to persist a change in the map scale in the Layout View.  Every time I changed the scale and saved the mxd – however the original scale would not change and the programmatic new scale was ignored!</p>
<p>This was very frustrating indeed, I was sure that there must be a way to persist this change as it’s not exactly NASA missile launch code – I’m just trying to change a scale damn it!</p>
<div id="attachment_149" class="wp-caption aligncenter" style="width: 580px"><a href="http://rantincsharp.files.wordpress.com/2010/10/arcmapui.png"><img class="size-full wp-image-149" title="ArcMapScale" src="http://rantincsharp.files.wordpress.com/2010/10/arcmapui.png?w=590" alt="ArcMap Scale"   /></a><p class="wp-caption-text">Highlight of the scale control in the layoutview of ArcMap</p></div>
<p><strong>Solution</strong></p>
<p>Anyway, it so happens that there is a fix, but it’s kind of unusual and not exactly intuitive or obvious to the developer coming at this problem cold.</p>
<p>Firstly we have to make use of some win32 API calls and most importantly to call IActiveView.Activate and pass our call to GetDesktopWindow().  This does the trick and is absolutely essential if you want to get this kind of change persisted.  Take a look at the code below to see how it’s done:</p>
<p><pre class="brush: csharp;">  
[DllImport(&quot;User32.dll&quot;)]
public static extern int GetDesktopWindow();

private void ChangeMyScale()
{
    IMapDocument MapDoc;
    mapDoc = new MapDocumentClass();
    mapDoc.Open(@&quot;C:\Foo\Bar.mxd&quot;,null);
    IPageLayout pageLayout = mapDoc.PageLayout;
    IActiveView activeView = (IActiveView)pageLayout;
    activeView = (IActiveView) mapDoc.PageLayout;
    activeView.Activate(GetDesktopWindow()); //Key line!!
    mapDoc.ActiveView.FocusMap.MapScale = 10000; //Now we can change the scale!!
    activeView.Refresh();

    MessageBox.Show(@&quot;We have an mxd called:&quot; + mapDoc.DocumentFilename +
    &quot;\nExtent: 1 to &quot; + mapDoc.ActiveView.FocusMap.MapScale);

    mapDoc.Save(true, false)
    mapDoc.Close();
}
</pre></p>
<p>Other things to bear in mind, code such as:</p>
<p><pre class="brush: csharp;">
MapDoc.SetActiveView((IActiveView)pageLayout)
</pre></p>
<p>only sets the view for the application as PageLayout, in order to get control of the specified window you have to use the Activate method:</p>
<p><pre class="brush: csharp;">
&lt;pre&gt;activeView.Activate(GetDesktopWindow())
</pre></p>
<p>When working with the IActiveView interface on a MapDocument object, you should always first call IActiveView::Activate() in order to properly initialize the display of the PageLayout or Map object.</p>
<p>The MxDocument, MapServer objects, MapControl and PageLayoutControl all initialise display objects automatically after opening an MXD, but MapDocument DOES NOT DO THIS, so you should call Activate() before working with any other members of IActiveView.</p>
<p>So to summarise, if your application has a user interface, you should call Activate() with the hWnd of the application&#8217;s client area.  If your application runs in the background and has no windows, you retrieve a valid hWnd from the GDI GetDesktopWindow() function, part of the Win32 API.</p>
<p><strong>Conclusion</strong></p>
<p>I am hopeful that ESRI will change this so that you don’t have to, what I view totally unnecessary calls to the Windows API etc.  Maybe it will be fixed properly in version 10 or some other update to that, but I wouldn’t hold your breath!</p>
<p>Anyway I hope it’s useful to you and stops you burning lots of valuable dev time!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=148&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2010/10/29/issues-with-persisting-changes-to-the-scale-in-pagelayout-layoutview-using-arcobjects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>

		<media:content url="http://rantincsharp.files.wordpress.com/2010/10/arcmapui.png" medium="image">
			<media:title type="html">ArcMapScale</media:title>
		</media:content>
	</item>
		<item>
		<title>ESRI Snippet: Adding a graphic to a map</title>
		<link>http://rantincsharp.wordpress.com/2010/05/24/esri-snippet-adding-a-graphic-to-a-map/</link>
		<comments>http://rantincsharp.wordpress.com/2010/05/24/esri-snippet-adding-a-graphic-to-a-map/#comments</comments>
		<pubDate>Mon, 24 May 2010 09:58:07 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[gis]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[arcobjects]]></category>
		<category><![CDATA[code-sample]]></category>
		<category><![CDATA[graphic]]></category>
		<category><![CDATA[vba]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=142</guid>
		<description><![CDATA[Really handy sometimes for debugging to make sure you are dealing with the correct geometry: Public Sub AddGraphicToMap(ByVal map As IMap, ByVal geometry As IGeometry) Dim graphicsContainer As IGraphicsContainer Set graphicsContainer = map Dim element As IElement Set element = Nothing Dim rgbColor As IRgbColor Set rgbColor = New rgbColor With rgbColor .Red = 111 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=142&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Really handy sometimes for debugging to make sure you are dealing with the correct geometry:</p>
<pre>Public Sub AddGraphicToMap(ByVal map As IMap, ByVal geometry As IGeometry)

 Dim graphicsContainer As IGraphicsContainer
 Set graphicsContainer = map

 Dim element As IElement
 Set element = Nothing

 Dim rgbColor As IRgbColor
 Set rgbColor = New rgbColor
 With rgbColor
 .Red = 111
 .Green = 111
 .Blue = 111
 .UseWindowsDithering = True
 End With

 Dim simpleFillSymbol As ISimpleFillSymbol
 Set simpleFillSymbol = New simpleFillSymbol

 simpleFillSymbol.Color = rgbColor
 simpleFillSymbol.Style = esriSFSForwardDiagonal

 Dim fillShapeElement As IFillShapeElement
 Set fillShapeElement = New PolygonElement

 fillShapeElement.Symbol = simpleFillSymbol
 Set element = fillShapeElement

 If Not (element Is Nothing) Then
 element.geometry = geometry
 graphicsContainer.AddElement element, 0
 End If

End Sub</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=142&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2010/05/24/esri-snippet-adding-a-graphic-to-a-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>ESRI Code Snippet: Find Layer by Name</title>
		<link>http://rantincsharp.wordpress.com/2010/05/24/esri-code-snippet-find-layer-by-name/</link>
		<comments>http://rantincsharp.wordpress.com/2010/05/24/esri-code-snippet-find-layer-by-name/#comments</comments>
		<pubDate>Mon, 24 May 2010 08:20:11 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[gis]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[arcobjects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[find-layer-by-name]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[vba]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=139</guid>
		<description><![CDATA[A handy code snippet from Neil Clemmons who is a prolific trouble shooter on the ESRI forums.  Sometimes it&#8217;s handy to have a bit of VBA code to find a layer by name and this code does the job very well.  Of course you can apply the same logic in any language and application context [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=139&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A handy code snippet from Neil Clemmons who is a prolific trouble shooter on the ESRI forums.  Sometimes it&#8217;s handy to have a bit of VBA code to find a layer by name and this code does the job very well.  <em>Of course you can apply the same logic in any language and application context you see fit.</em></p>
<pre>Public Function GetLayerByFeatureClass(vMap As Variant, sFeatureClassName As String, Optional bMessages As Boolean = True) As ILayer
     Dim pApplication As IApplication
     Dim pMxDocument As IMxDocument
     Dim pCompositeLayer As ICompositeLayer
     Dim pMap As IMap
     Dim l As Long
     Dim m As Long

     On Error GoTo ErrorHandler

     ' Get map reference from vMap parameter.
     If TypeOf vMap Is IMxApplication Then
          Set pApplication = vMap
          Set pMxDocument = pApplication.Document
          Set pMap = pMxDocument.FocusMap
     ElseIf TypeOf vMap Is IMxDocument Then
          Set pMxDocument = vMap
          Set pMap = pMxDocument.FocusMap
     ElseIf TypeOf vMap Is IMap Then
          Set pMap = vMap
     Else
          If bMessages Then MsgBox "vMap parameter does not implement an interface supported by this function.", vbOKOnly, "GetLayerByFeatureClass()"

          Exit Function
     End If

     ' Process each layer in the map.
     For l = 0 To pMap.LayerCount - 1
          Set GetLayerByFeatureClass = LayerByFeatureClass(pMap.Layer(l), sFeatureClassName, bMessages)
          If Not GetLayerByFeatureClass Is Nothing Then Exit Function
     Next l

     ' Give layer not found message.
     If bMessages Then MsgBox "The layer '" &amp; sFeatureClassName &amp; "' could not be found in the map.", vbOKOnly, "GetLayerByFeatureClass()"
Exit Function
ErrorHandler:
     If bMessages Then ErrorMessage "modAOUtilities:GetLayerByFeatureClass()"
End Function

' Written by: Neil Clemmons
' Date Created: 12/26/2002
' Date Modified:
' Description:  Helper function for GetLayerByFeatureClass().  Uses recursion to find layers that may be inside nested
'               group layers.  If this function returns a value other than Nothing, the layer has been found and
'               the search will stop.  Otherwise, the search will continue until all layers have been processed.
Private Function LayerByFeatureClass(pLayer As ILayer, sName As String, bMessages As Boolean) As ILayer
     Dim pDataset As IDataset
     Dim pReturnLayer As ILayer
     Dim pFeatureLayer As IFeatureLayer
     Dim pCompositeLayer As ICompositeLayer
     Dim l As Long

     On Error GoTo ErrorHandler

     ' If layer is a feature layer, get it's underlying dataset.
     If TypeOf pLayer Is IFeatureLayer Then
          Set pFeatureLayer = pLayer
          Set pDataset = pFeatureLayer.FeatureClass

          ' Set return layer and exit if this layer is the layer being sought.
          If UCase$(pDataset.Name) = UCase$(sName) Then
               Set LayerByFeatureClass = pLayer
               Exit Function
          End If
     End If

     ' Exit if layer is not a group layer.  Not setting return value will cause search to continue.
     If Not TypeOf pLayer Is IGroupLayer Then Exit Function

     ' Process each layer in the group layer.
     Set pCompositeLayer = pLayer
     For l = 0 To pCompositeLayer.Count - 1
          ' Use recursion to traverse nested group layers.
          Set pReturnLayer = LayerByFeatureClass(pCompositeLayer.Layer(l), sName, bMessages)

          ' If layer was found, set return value and exit.
          If Not pReturnLayer Is Nothing Then
               Set LayerByFeatureClass = pReturnLayer
               Exit Function
          End If
     Next l
Exit Function
ErrorHandler:
     If bMessages Then ErrorMessage "modAOUtilitiesLayerByName()"
End Function
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=139&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2010/05/24/esri-code-snippet-find-layer-by-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
		<item>
		<title>Update: Bing Maps and Ordnance Survey data in ArcGIS Server 9.3.1</title>
		<link>http://rantincsharp.wordpress.com/2010/02/03/update-bing-maps-and-ordnance-survey-data-in-arcgis-server-9-3-1/</link>
		<comments>http://rantincsharp.wordpress.com/2010/02/03/update-bing-maps-and-ordnance-survey-data-in-arcgis-server-9-3-1/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 12:09:50 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[gis]]></category>
		<category><![CDATA[ags]]></category>
		<category><![CDATA[arcgis-server]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[esri]]></category>
		<category><![CDATA[ordnance-survey]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://rantincsharp.wordpress.com/?p=130</guid>
		<description><![CDATA[Apparently it is a known problem for OS data to not line up with Bing Maps service and in order to get round this you have to re-project all your British National Grid data to the WGS 1984 Web Mercator (Auxiliary Sphere) coordinate system.  How rubbish is that! Anyway this problem is apparently known to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=130&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Apparently it is a known problem for OS data to not line up with Bing Maps service and in order to get round this you have to re-project all your British National Grid data to the WGS 1984 Web Mercator (Auxiliary Sphere) coordinate system.  How rubbish is that!</p>
<p>Anyway this problem is apparently known to ESRI and it is apparently fixed in verison 10 (it was tested by ESRI support in a beta 10 version).  So I guess we will have to wait until thats out and a few service packs have been released until we can feel confident with rolling out version 10.</p>
<p>On that note I&#8217;ll talk about this issue in about another year to 18 months (I would have thought!)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rantincsharp.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rantincsharp.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rantincsharp.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rantincsharp.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rantincsharp.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rantincsharp.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rantincsharp.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rantincsharp.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rantincsharp.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rantincsharp.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rantincsharp.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rantincsharp.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rantincsharp.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rantincsharp.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rantincsharp.wordpress.com&amp;blog=3622497&amp;post=130&amp;subd=rantincsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rantincsharp.wordpress.com/2010/02/03/update-bing-maps-and-ordnance-survey-data-in-arcgis-server-9-3-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/959e169893c5d1a7b562c9dbdf750708?s=96&#38;d=identicon" medium="image">
			<media:title type="html">earnshaw</media:title>
		</media:content>
	</item>
	</channel>
</rss>
