procedure OleCheck(Result: HResult);
Use OleCheck to wrap any IUnknown based COM methods you call, so that if that method fails, an exception will be raised. Also see the Using COM Automation objects topic.