Here's a tip how to get the actual component object (edge, point, polygon) from a custom tool snap/pick operation.
This is useful for example in case you want to highlight an edge.
The component arrives as the first and only element of the Component Collection of the SubComponent property of a CollectionItem. Phew ,).... The C++ API doesn't provide access to either of those elements, so you'll have to go through the CComAPIHander again (similar to handling component selections)
So basically to get the component, you will have to do:
CRef ref = in_ctxt.GetSnapComponent();
if(LONG(cCompColl.GetProperty(L"Count")) != 1L)
CStatus bOk = cCompColl.Invoke(L"Item", CComAPIHandler::PropertyGet, rVal, rrParams);
would have been easier.... but it works
Note that snap works on the unsubdivided mesh of a subd surface, and pick works on the subdivided mesh (uses a hidden pick bitmap)
Hope this helps somebody get started with custom tool programming.