Get Distance at Location Along Spline

Thank you so much ! I was looking for a more accurate c++ function and yours is perfect