Resonance scattering theory and the structure of compound states