Bound and virtual bound states in semiconductor quantum wells