Converting .40 to 10mm.
You may need more than the barrel.
In a small-framed gun, like a Glock 22, you need a larger frame that will accomodate the larger mags, needed for the longer round.
On a gun that was designed for .45, you can move down (if you find suitable mags). ON a gun designed for 9mm or .40, the best you'll do is .40 -- and then only if the slide will accomodate the barrel. (EAA guns have interchangeable 9mm/.40 barrels, and they function fine that way. With many other guns, the barrel opening in the slide isn't right to accept the larger diameter barrel.)
For most caliber conversions, there is the question as to whether headspace will be right and whether the extractor will work. (Not generally a problem with .40/10mm conversions.)
Its not a slam dunk, and for some guns, A LOT MORE THAN JUST GETTING THE BARREL!
Most .45 barrels are much larger (in diameter) than most .40 or 10mm barrels. Don't assume they will swap. Many gun makers require the entire top end to be replaced, when the frame will handle the load.