andrewhayden

Creating a predefined geographic coordinate system issue

Discussion created by andrewhayden on Sep 29, 2011
Latest reply on Sep 29, 2011 by andrewhayden
I'm working with the VB Example of creating a predefined geographic coordinate system in VS 2008 Express and I encounter the error:

'esriSRGeoCSType' is not accessible in this context because it is 'Friend'.

I'm wondering the cause of the error and how I might go about resolving it.

Any thoughts?

    Private Sub CreateGeographicReferenceSystem()
        ' Set up the SpatialReferenceEnvironment.
        ' SpatialReferenceEnvironment is a singleton object and needs to use the Activator class.

        Dim t As Type = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment")
        Dim obj As System.Object = Activator.CreateInstance(t)
        Dim srFact As ESRI.ArcGIS.Geometry.ISpatialReferenceFactory = obj

        ' Use the enumeration to create an instance of the predefined object.

        Dim geographicCS As IGeographicCoordinateSystem = srFact.CreateGeographicCoordinateSystem(esriSRGeoCSType.esriSRGeoCS_NAD1983)
    End Sub

Outcomes