Just to let you know I didn't forget about this thread.

I really would like to have an SDK for FreePascal but in all my tests, thinBasic BSTR strings passed as WideStrings in FreePascal retain their memory allocated and never release it. WideStrings a re managed by FreePascal heap manager and they are counted strings not really BSTR strings.

I'm still testing in order to find a solution.

I have a possible solution that is to use OLE32 native Sys* functions ( https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx ) in FreePascal source code but this would require a lot of work for the programmer developing thinBasic module using FreePascal. Maybe I will wrap some helper functions.