Misfit dislocations in epitaxial films III. Theory