问题描述
用AE控件,VB做一个坐标转换的软件,在CreateFeatureClass函数那里遇到COM异常“对COM组件的调用返回了错误HRESULTE_FAIL。”DimfacAsIWorkspaceFactoryfac=NewShapefileWorkspaceFactoryDimtoSpaceAsIFeatureWorkspacetoSpace=fac.OpenFromFile(_SevenPar.filePath,0)DimfromFeatureClassAsIFeatureClassfromFeatureClass=pFeatureClasspSpatialReferenceF=NewSpatialReferenceEnvironmentDimoutSRAsISpatialReferenceoutSR=pSpatialReferenceF.CreateGeographicCoordinateSystem(esriSRGeoCS3Type.esriSRGeoCS_Xian1980)DiminSRAsISpatialReferenceinSR=pGeoDataset.SpatialReferenceDimpFieldsAsIFieldspFields=NewFields(_SevenPar.filePath,outSR)DimtoFeatureClassAsIFeatureClasstoFeatureClass=toSpace.CreateFeatureClass("123",pFields,Nothing,Nothing,esriFeatureType.esriFTSimple,"Shape","")‘对COM组件的调用返回了错误HRESULTE_FAIL。DimpFCAsIFeatureCursor
解决方案
解决方案二:
已试过网上找得到的各种方法:1.ArcEngineLisense问题Dimm_AoInitializeAsIAoInitializem_AoInitialize=NewAoInitializeDimlicenseStatusAsesriLicenseStatuslicenseStatus=esriLicenseStatus.esriLicenseUnavailablelicenseStatus=m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine)
2.开启DTC,并设置入站、出站推责3.CreateFeatureClass函数中的第一个参数【文件名】如果已经存在也可能报错但都没有用求大神相助~~~