cast handle to long