SelectionSet is not being recognized after ISelectionEvents::SelectionChanged event is called.
上次发布: August 25, 2014No Product Found
漏洞 ID 编号
NIM010465
已提交
July 20, 2007
上次修改时间
June 5, 2024
适用范围
No Product Found
找到的版本
9.2
编程语言
VBA
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
No Public Explanation
解决办法
**Pls be advised:**This "workaround" only averts the error message. **It does not provide a solution to the problem itself.Option ExplicitPrivate m_pPlatFile As ITablePrivate pTableSel As ITableSelectionPrivate WithEvents mTableSelEvents As StandaloneTablePrivate Sub InitEvents() Dim pMxDoc As IMxDocument Set pMxDoc = Application.Document Dim pTColl As IStandaloneTableCollection Set pTColl = pMxDoc.FocusMap Set m_pPlatFile = pTColl.StandaloneTable(0) Set pTableSel = m_pPlatFile Set mTableSelEvents = m_pPlatFileEnd SubPrivate Sub mTableSelEvents_SelectionChanged() Dim pPlatSelSet As ISelectionSet Set pPlatSelSet = pTableSel.SelectionSet Dim pPlatCursor As ICursor pPlatSelSet.Search Nothing, True, pPlatCursor Dim pPlatRow As IRow Set pPlatRow = pPlatCursor.NextRow If Not pPlatRow Is Nothing Then Debug.Print pPlatRow.Value(1) 'Output a message informaing the user which plat number that he/she entered Dim intPlatEntered As Integer intPlatEntered = MsgBox("You entered plat number " & pPlatRow.Value(1), vbOKCancel, "Plat number entered") Set pTableSel = Nothing Set pPlatSelSet = Nothing Set pPlatCursor = Nothing Dim lngPlatFieldNum As Long Dim trPlatNumber As String Dim strPlatNumber As String lngPlatFieldNum = m_pPlatFile.FindField("Name") strPlatNumber = pPlatRow.Value(lngPlatFieldNum) Set pPlatRow = Nothing Set pPlatRow = Nothing Set m_pPlatFile = Nothing End IfEnd Sub