Me2

Co-Creating a SimpleTextParser

Discussion created by Me2 on Oct 14, 2011
What's wrong with this code... or is it an ArcGIS bug?

  Dim Text As String = "<BOL>My bold text</BOL>"
  Dim aTextParser As ESRI.ArcGIS.Display.ITextParser

  'The next line creates an unhandled COMException error. Why? SimpleTextParser is supposed to be a co-creatable class!
  aTextParser = New ESRI.ArcGIS.Display.SimpleTextParser

  aTextParser.Text = Text
  Dim bHasTags As Boolean
  aTextParser.HasTags(bHasTags)
  If bHasTags Then
   MsgBox(Text & " HAS TAGS")
  Else
   MsgBox(Text & " DOESN'T HAVE TAGS")
  End If

Outcomes