How can you get stronger while losing weight?

Exercise, do weights. The human body adapts to the challenges it meets, so a person's muscles get stronger if they are exercised, especially against resistance or with weights. This strengthening occurs regardless of whether the person is gaining weight, losing weight, or staying the same. With walking, running, biking, etc., he moves his body weight. In weight training, he challenges his muscles with heavier weights.
Lose fat/gain muscle. If you eat a well balanced diet (don't eat more than you can burn off), and add weight bearing exercises/high resistance training, you can lose the fat and gain muscle/strenghth at the same time. Most overweight folks are heavy because of extra fat, not exra muscle. So, if you do it right, you can have both. Consult a nutritionist and a personal trainer if you need help. Best of luck to you.