If a legend entry recordset came from a CustomFieldsPipe, is it possible to get the real name for the pipe that was actually used? (It could have been, for example 'AddNewGeometryColumnPipe'.)
There's a technique to determine the "outer pipe", but it is not completely robust. The CustomFieldsPipe object takes as input an object that implements the IGM_CustomFieldsService interface. Normally, the outer pipe, such as the example AddNewGeometryColumnPipe, will be the class that implements the service. In this case, you can get an instance to the outer pipe by:
' Assumes the GRecordset being passed in came from the CustomFieldsPipe.
' Also assumes that the outer pipe, AddNewGeometryColumnPipe, implements IGM_CustomFieldsService.
public sub DisplayOutputFieldName( grs as GRecordset )
Dim objANGCP as AddNewGeometryColumnPipe
Dim objCFP as CustomFieldsPipe
set objCFP = grs.GetExtension( "CustomFieldsPipe" )
set objANGCP = objCFP.CustomFieldsService
This will only work if the outer pipe is the same class that implements the IGM_CustomFieldsService interface. If so, the object returned from the objCFP.CustomFieldsService property is the outer pipe. And since the outer pipe also exposes its outer pipe interface (the one with, for example, the OutputFieldName property), setting objANGCP to this pipe will do a COM QueryInterface call that will return the outer pipe's interface. The drawback, of course, is if the IGM_CustomFieldsService is implemented by a different class than the outer pipe.