ArcEngine 在VS2010WPF中AoInitializeClass 无构造函数的问题

在程序中把AoInitializeClass改为AoInitialize就可以了!

如下:

AoInitialize aoi = new AoInitialize();// AoInitializeClass();

            //more license choices could be included here
            //esriLicenseProductCode productCode = esriLicenseProductCode.esriLicenseProductCodeEngine;
            esriLicenseProductCode productCode = esriLicenseProductCode.esriLicenseProductCodeArcServer;
            if (aoi.IsProductCodeAvailable(productCode) == esriLicenseStatus.esriLicenseAvailable)
            {
                aoi.Initialize(productCode);
            }

 

/// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            //设置启动界面
            //Uri u = new Uri("frmMain.xaml", UriKind.Relative);
            Uri u=new Uri("frmLoginUI.xaml",UriKind.Relative);
            this.StartupUri =u;

            InitializeEngineLicense();

            this.Exit += new ExitEventHandler(App_Exit);
        }

        void App_Exit(object sender, ExitEventArgs e)
        {
           
            ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown();
        }

        private void InitializeEngineLicense()
        {
            AoInitialize aoi = new AoInitialize();// AoInitializeClass();

            //more license choices could be included here
            //esriLicenseProductCode productCode = esriLicenseProductCode.esriLicenseProductCodeEngine;
            esriLicenseProductCode productCode = esriLicenseProductCode.esriLicenseProductCodeArcServer;
            if (aoi.IsProductCodeAvailable(productCode) == esriLicenseStatus.esriLicenseAvailable)
            {
                aoi.Initialize(productCode);
            }
        }
    }

posted @ 2010-05-12 18:32  sqlite例子  阅读(194)  评论(0)    收藏  举报