laptop and a wrench

漏洞

Unable to call IGraphicsContainer.LocateElements() in MxDocument_OpenDocument event to get PageLayout elements.

上次发布: April 6, 2018 ArcGIS for Desktop
漏洞 ID 编号 NIM063686
已提交December 18, 2010
上次修改时间June 5, 2024
适用范围ArcGIS for Desktop
找到的版本10.0
编程语言VBA
状态Will Not Be Addressed

附加信息

Currently, we have no plans to address this issue.

解决办法

' Remove or comment-out the line ' Set pEnumElement = pGraphicsContainer.LocateElements(pPoint, 0.2) ' as it will be inside the Do Loop of this workaround as shown below: Set pEnumElement = Nothing lngCounter = 0 Do While pEnumElement Is Nothing Set pEnumElement = pGraphicsContainer.LocateElements(pPoint, 0.2) lngCounter = lngCounter + 1 Debug.Print lngCounter '*************************************************************** 'Using DoEvents here. Without DoEvents, pEnumElement is always 'Nothing and an endless loop will occur. '*************************************************************** DoEvents '******************************************************************** 'This avoids endless loop whenever DoEvents is not used. This should 'not be needed with DoEvents, but is here in case DoEvents is removed, 'otherwise, endless loop occurs and document will never open. '******************************************************************** If lngCounter > 100000 Then Exit Function MsgBox "Exit Function" End If Loop '************************************************************************ 'Alternatively to DoEvents, using MsgBox gives time for PageLayout 'elements to load. When user dismisses MsgBox, all elements have loaded. '************************************************************************ 'MsgBox "Adding stamp..."

重现步骤

漏洞 ID: NIM063686

软件:

  • ArcGIS for Desktop

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项