今天在使用IFeature 接口下的CreateFeature()方法创建要素时,报错如下图:
应该是许可或权限的问题,具体原因不明。但用下面的方法解决了问题,在此记录一下。
解决办法:在主程序main()函数中添加如下代码即可:
AoInitialize aoi = new AoInitializeClass();
esriLicenseProductCode productCode = esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB;
if (aoi.IsProductCodeAvailable(productCode) == esriLicenseStatus.esriLicenseAvailable)
{
aoi.IsProductCodeAvailable(productCode);
if (aoi.Initialize(productCode) != ESRI.ArcGIS.esriSystem.esriLicenseStatus.esriLicenseCheckedOut)
DevExpress.XtraEditors.XtraMessageBox.Show(",请检查ArcEngine中的GDBEdit许可!");
}
else
{
DevExpress.XtraEditors.XtraMessageBox.Show(",请检查ArcEngine中的GDBEdit许可!");
}
本文介绍了一种在使用IFeature接口下CreateFeature()方法创建要素时遇到许可错误的解决方案。通过在主程序main()函数中添加特定代码初始化许可,可以有效避免许可或权限问题。

2236

被折叠的 条评论
为什么被折叠?



