std::vector<wstring> feature_classes;
hr = geodatabase.GetChildDatasets(L"\\", L"Feature Class", feature_classes));
for (i = 0; i < feature_classes.size(); i++)
{
wstring this_table = feature_classes;
Table table;
hr = geodatabase.OpenTable(this_table, table);
// Get the field type and name from the row enumerator.
FieldInfo fieldInfo;
table.GetFieldInformation(fieldInfo);
int fieldCount;
FieldType fieldType;
wstring wstrFieldName;
wstring wstrLabelField;
std::vector<FieldDef> fieldDefs;
hr = table.GetFields( fieldDefs );
fieldInfo.GetFieldCount(fieldCount);
for (long fieldNumber = 0; fieldNumber < fieldCount; fieldNumber++)
{
fieldInfo.GetFieldType(fieldNumber, fieldType);
fieldInfo.GetFieldName(fieldNumber, wstrFieldName);
if (fieldTypeGeometry == fieldType)
{
FieldDef fieldDef = fieldDefs[fieldNumber];
GeometryDef geometryDef;
hr = fieldDef.GetGeometryDef( geometryDef );
SpatialReference spatialReference;
hr = geometryDef.GetSpatialReference(spatialReference);
wstring wstrSpatialReferenceText;
hr = spatialReference.GetSpatialReferenceText( wstrSpatialReferenceText );
int wkid;
hr = spatialReference.GetSpatialReferenceID( wkid );
}