Meldeamt, Militäramt und Wahlamt