Get distance between particular feature and another component?

How can I get the distance between a feature and a component programmatically?

        private double distanceBetween(IFeature feature, Component2 component)

        {

            feature.Select(false);

            component.Select(true);

            measure.Calculate(null);

            return measure.Distance;

        }

That function doesn't work; when I tried selecting the feature and component by hand and using the UI-based measure tool, it didn't work, either.  I need to know if a particular part of a component is intersecting another component... what is the best way to do this?

SolidworksApi macros