Fun with threads

::: {.Section1}

Whenever I run into a programming problem that doesn't have an immediately obvious solution, the first thing I do is put the error into google …. This approach rarely works for tablet problems - there just aren't enough developers operating at an advanced level. ….

One thing that can make working with the Real-time stylus API challenging is that you need to be very aware of what thread things are happening on… [via]{style="FONT-STYLE: italic"} [Tom Clarkson's Blog]

I’m really enjoying Tom Clarkson’s blog. These two quotes come from two closely-spaced posts that cropped up the day after I added the following comments in my own testing code:

``` {.MsoNormal style="TEXT-ALIGN: justify"} /* * When RTS is added to renderMesh, Form.Close() throws COM Exception. KB sez:

  • COM Exception: Automation clients are required by COM to process input-synchronous calls without interruption,
  • and therefore are prevented from making outgoing Automation calls while processing such messages.
  • Hmmmm....
  • Causes redlight in test suite, of course, but functionality is actually still okay.
  • Hmmm....
  • Commenting out the addition of plugins to RTS doesn't end the problem.
  • Setting Enabled = false ends the problem.
  • Hmmm....
  • Idiot! frm.Close() was being called from another thread.
  • Solution as simple as frm.Invoke(); ```

``` {.ngrelatedlinks style="MARGIN-LEFT: -0.5in"}

``` :::