You can't SWAP barrels in an M&P just like you can't swap barrels in the Glocks. You CAN however purchase a "conversion barrel" for a M&P 40 that will allow you to shoot 9mm. Stormlake Makes these conversions barrels for the M&P's. Handgun Barrels 1911 Glock Springfield Sig Sauer - The Official Website of Storm Lake Barrels - Available in Canada and USA
You can't just take the barrel out of a 9mm M&P and put it in .40 M&P and expect it to shoot.