The IFeatureSelection.SelectFeatures Method throws (RPC_E_SERVERFAULT ) exceptions when called with a query filter on an ArcMap dataset from an external Windows Forms application
上次发布: December 22, 2016ArcObjects SDK
漏洞 ID 编号
BUG-000096943
已提交
June 7, 2016
上次修改时间
June 5, 2024
适用范围
ArcObjects SDK
找到的版本
10.4
操作系统
Windows OS
操作系统版本
7.0 64 Bit
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
We apologize that we were unable to address this issue within the current product support cycle. If the issue continues to affect your work in a supported release, please contact Technical Support.
解决办法
Use the IObjectFactory ArcObjects to get around the problem:C# Code:[STAThread()] static void Main(string[] args) { //ESRI License Initializer generated code. m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeBasic, esriLicenseProductCode.esriLicenseProductCodeStandard, esriLicenseProductCode.esriLicenseProductCodeAdvanced }, new esriLicenseExtensionCode[] { }); //ESRI License Initializer generated code. IAppROT pROT = new AppROT(); int itmCnt = 0; IApplication pAPP = null; while (itmCnt < pROT.Count) { pAPP = pROT.Item[itmCnt]; if (<a href="http://pAPP.Name" target="_blank">pAPP.Name</a> == "ArcMap") break; itmCnt++; } IMxDocument pMX = pAPP.Document as IMxDocument; IFeatureLayer pFL = pMX.FocusMap.Layer[0] as IFeatureLayer; IFeatureSelection pFSel = pFL as IFeatureSelection; ///TestConsole application space IQueryFilter pQF = new QueryFilter(); /// appRot application space IObjectFactory objectFactory = (IObjectFactory)pAPP; IPersist persist = (IPersist)pQF; System.Guid typeClassID; persist.GetClassID(out typeClassID); pQF = (IQueryFilter)objectFactory.Create(typeClassID.ToString("B")); pQF.WhereClause = "1=1"; IFeatureClass FC = pFL.FeatureClass; IFeatureCursor pFeatCursor = FC.Search(pQF, false); //pFSel.SelectionSet.Select(pQF, esriSelectionType.esriSelectionTypeHybrid, esriSelectionOption.esriSelectionOptionNormal, ((IDataset)pFL.FeatureClass).Workspace); pFSel.SelectFeatures(pQF, esriSelectionResultEnum.esriSelectionResultNew, true); //Do not make any call to ArcObjects after ShutDownApplication() }