Invalid handle

This error has the following possible causes and solution: