How to retrieve the return code from an executable object