My current CO gun is a gen 3 Glock 22 frame with a brownells gen 3 glock 17 slide and factory glock 17 barrel.
Sarge is correct about the rules for that kind of swap.
For the most part if you use a glock 24 frame with a glock 34 upper for CO most people are not going ask what model of glock frame that is.