PtProtectCallbacks (state)
This function is designed to be used in code that surrounds callbacks. As such, it protects code related to those callbacks from possible errors. If, for example, an error occurs, the error will be thrown but the callback function will complete safely. This means that if more than one error occurs in processing a callback, only the first error will be reported.
Of course, if this function is not called and errors occur, they will all be reported. However, the callback will terminate early, which could cause failures in subsequent Photon calls. This is especially noticeable if the error causes the drawing state to get damaged, so that subsequent draws do not complete properly. You will find areas of the screen are not redrawn, or are redrawn with the wrong data. The effect is localized to your program, though, so it won't harm the underlying Photon environment.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.