Great, TripleX!
It's good that we're progressively 'filling up' these code.
I'm learning a lot from specific lines in your code, like string management.
Note that there are some differences on the code - I was using an SDK version prior to 6.40.2 thus the string elements used to be txt->pstrings[1] instead of txt->string[1].