The code is written as below:
// Wait for an image and then retrieve it. A timeout of 5000 ms is used.
camera.RetrieveResult( 5000, ptrGrabResult, TimeoutHandling_ThrowException);
To solve this issue, users may modify the code as shown in the below:
// Wait for an image and then retrieve it. A Infinite timeout is used.
camera.RetrieveResult( INFINITE, ptrGrabResult, TimeoutHandling_ThrowException);