PtSetResource for progress bar not working

ver: QNX 6.1
Hi guys. I’m tearing my hair out here.

Basically at the moment I’m reading integers from the serial port and trying to use them to set the PT_ARG_GAUGE_VALUE of a progress bar.

When I call PtSetResource the program crashes.

However if I make a callback to a a slider bar I can change the value of the progress bar fine.

I use printf to check that the integers from the serial port are valid and they are.

The only difference between the two is the fact that one is called from from my own thread and one is called from within a callback.

Photon is not thread safe, so you want to call ‘PtEnter()’ before setting the progress, and ‘PtLeave()’ when you are done, this allows you to do Photon stuff from within threads.

Great Thanks… That did the trick