Actually,
The equation you want is: (M1+M2+M3)Vi=M1V1+M2V2+M3(V3+V2), where:
Vi is the initial velocity of the gun, 0 if possible
M1 is the mass of the projectile, always positive
V1 is the velocity of the projectile, positive
M2 is the mass of the glock's frame, positive
V2 is the velocity of the frame, negative
M3 is the mass of the slide, positive
V3 is the velocity of the slide, negative
V2 is used to soak up the recoil that the slide does not eliminate(the term M3V3 is the recoil of the slide, actually a lot more complex due to varying speeds due to the spring, but it will suffice for this equation). M3 is multiplied by both V3 and V2 because the slide also moves with the frame from the recoil not absorbed by the recoil spring (which is equal to M3V3).
Basically, you find the velocity of the bullet, and the velocity of your slide and the masses of the bullet, slide and frame, and you can figure out the recoil of the gun you will feel, which is equal to (M2+M3)(V2).
Kharn