Select to view content in your preferred language

License needed for AxPageLayout Control

788
1
01-28-2011 08:32 AM
GregoryDillon
Occasional Contributor
I just upgraded to 10 and now my .Net solution seems stop working when it hits the line:

AxPageLayoutControl1.LoadMxFile(MXDFilePath)

I don't get an error, it just quits.    Has the licensing changed with 10?   I used to use a desktop license with 9.3.1.

I've added the new binding (see below):

Public Sub New()

        ESRI.ArcGIS.RuntimeManager.BindLicense(ProductCode.EngineOrDesktop)
      
        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub

and call the following subroutine in the form_load event

Private Sub HandleLicense()
        Dim AoInit As ESRI.ArcGIS.esriSystem.AoInitialize = New ESRI.ArcGIS.esriSystem.AoInitialize
        If AoInit.IsProductCodeAvailable(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcServer) = ESRI.ArcGIS.esriSystem.esriLicenseStatus.esriLicenseAvailable Then
            AoInit.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcServer)

        ElseIf AoInit.IsProductCodeAvailable(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeEngine) = ESRI.ArcGIS.esriSystem.esriLicenseStatus.esriLicenseAvailable Then
            AoInit.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeEngine)

        ElseIf AoInit.IsProductCodeAvailable(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcInfo) = ESRI.ArcGIS.esriSystem.esriLicenseStatus.esriLicenseAvailable Then
            AoInit.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcInfo)

        ElseIf AoInit.IsProductCodeAvailable(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcEditor) = ESRI.ArcGIS.esriSystem.esriLicenseStatus.esriLicenseAvailable Then
            AoInit.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcEditor)

        End If
    End Sub
0 Kudos
1 Reply
RuchiraWelikala
Regular Contributor
With ArcGIS10 you need the Engine license to use mapcontrols.  It's something everyone is complaining about.  There are some ways around it.
http://forums.arcgis.com/threads/22020-Migrating-from-9.3.1-to-10-may-be-impossible-if-you-use-mapco...

cheers,
0 Kudos