<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Creating a predefined geographic coordinate system issue in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/creating-a-predefined-geographic-coordinate-system/m-p/178020#M4597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm working with the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Creating_a_predefined_geographic_coordinate_system/0001000009sr000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;VB Example of creating a predefined geographic coordinate system&lt;/A&gt;&lt;SPAN&gt; in VS 2008 Express and I encounter the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'esriSRGeoCSType' is not accessible in this context because it is 'Friend'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm wondering the cause of the error and how I might go about resolving it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub CreateGeographicReferenceSystem()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set up the SpatialReferenceEnvironment.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' SpatialReferenceEnvironment is a singleton object and needs to use the Activator class.

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim t As Type = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obj As System.Object = Activator.CreateInstance(t)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim srFact As ESRI.ArcGIS.Geometry.ISpatialReferenceFactory = obj

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Use the enumeration to create an instance of the predefined object.

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim geographicCS As IGeographicCoordinateSystem = srFact.CreateGeographicCoordinateSystem(&lt;SPAN style="text-decoration:underline;"&gt;esriSRGeoCSType&lt;/SPAN&gt;.esriSRGeoCS_NAD1983)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:08:44 GMT</pubDate>
    <dc:creator>AndrewHayden1</dc:creator>
    <dc:date>2021-12-11T09:08:44Z</dc:date>
    <item>
      <title>Creating a predefined geographic coordinate system issue</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/creating-a-predefined-geographic-coordinate-system/m-p/178020#M4597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm working with the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Creating_a_predefined_geographic_coordinate_system/0001000009sr000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;VB Example of creating a predefined geographic coordinate system&lt;/A&gt;&lt;SPAN&gt; in VS 2008 Express and I encounter the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'esriSRGeoCSType' is not accessible in this context because it is 'Friend'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm wondering the cause of the error and how I might go about resolving it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub CreateGeographicReferenceSystem()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set up the SpatialReferenceEnvironment.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' SpatialReferenceEnvironment is a singleton object and needs to use the Activator class.

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim t As Type = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obj As System.Object = Activator.CreateInstance(t)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim srFact As ESRI.ArcGIS.Geometry.ISpatialReferenceFactory = obj

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Use the enumeration to create an instance of the predefined object.

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim geographicCS As IGeographicCoordinateSystem = srFact.CreateGeographicCoordinateSystem(&lt;SPAN style="text-decoration:underline;"&gt;esriSRGeoCSType&lt;/SPAN&gt;.esriSRGeoCS_NAD1983)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:08:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/creating-a-predefined-geographic-coordinate-system/m-p/178020#M4597</guid>
      <dc:creator>AndrewHayden1</dc:creator>
      <dc:date>2021-12-11T09:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a predefined geographic coordinate system issue</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/creating-a-predefined-geographic-coordinate-system/m-p/178021#M4598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you don't have an Imports statement at the top of the code module for the correct library you'll have to fully qualify it just like you've done here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim srFact As &lt;/SPAN&gt;&lt;STRONG&gt;ESRI.ArcGIS.Geometry.&lt;/STRONG&gt;&lt;SPAN&gt;ISpatialReferenceFactory = obj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 13:59:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/creating-a-predefined-geographic-coordinate-system/m-p/178021#M4598</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-09-29T13:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a predefined geographic coordinate system issue</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/creating-a-predefined-geographic-coordinate-system/m-p/178022#M4599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Neil, but I still don't understand.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a reference to ESRI.ArcGIS.Geometry and have an imports statement for it.&amp;nbsp; My module looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Imports ESRI.ArcGIS.Geometry

Module Module1

&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub CreateGeographicReferenceSystem()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set up the SpatialReferenceEnvironment.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' SpatialReferenceEnvironment is a singleton object and needs to use the Activator class.

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim t As Type = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obj As System.Object = Activator.CreateInstance(t)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim srFact As ESRI.ArcGIS.Geometry.ISpatialReferenceFactory = obj

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Use the enumeration to create an instance of the predefined object.

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim geographicCS As IGeographicCoordinateSystem = srFact.CreateGeographicCoordinateSystem(&lt;SPAN style="text-decoration:underline;"&gt;esriSRGeoCSType&lt;/SPAN&gt;.esriSRGeoCS_NAD1983)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

End Module&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:08:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/creating-a-predefined-geographic-coordinate-system/m-p/178022#M4599</guid>
      <dc:creator>AndrewHayden1</dc:creator>
      <dc:date>2021-12-11T09:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a predefined geographic coordinate system issue</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/creating-a-predefined-geographic-coordinate-system/m-p/178023#M4600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay, I see replacing&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;Dim geographicCS As IGeographicCoordinateSystem = srFact.CreateGeographicCoordinateSystem(esriSRGeoCSType.esriSRGeoCS_NAD1983)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;with this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;Dim geographicCS As IGeographicCoordinateSystem = srFact.CreateGeographicCoordinateSystem(ESRI.ArcGIS.Geometry.esriSRGeoCSType.esriSRGeoCS_NAD1983)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;does the trick.&amp;nbsp; Thought, if I have the imports statement, I'm not entirely clear why.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 15:42:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/creating-a-predefined-geographic-coordinate-system/m-p/178023#M4600</guid>
      <dc:creator>AndrewHayden1</dc:creator>
      <dc:date>2011-09-29T15:42:35Z</dc:date>
    </item>
  </channel>
</rss>

