Hello,
for some time I have been working through the book "The Developer's Reference Guide To Microsoft Small Basic" by Philip Conrod and Lou Tylee. In Chapter 20 "Animation" I have problems with the sound not playing properly and there is also an error message: "The calling thread cannot access this object because the object is owned by another thread."
Can someone tell me why the error message occurs in the "TickSub()" procedure?
Regards ... Gregor
Answer by "Mohammad Hamdy Ghanem": I review the source code, and seems that the code of the GetMediaPlayer method used in the sound class needs to be wrapped in a call to the SmallBasicApplication.Invoke() method. This also needs to be done with all the sound methods like play and stop.
I did that in sVB and it will be available in a next release.
Note that such questions is better posted at https://docs.microsoft.com/.../topics/small-basic.html
and clearly this is a bug, so it should be reported in the SB editor repo, but I don't anything to be fixed in the desktop version of SB.