public static void MyInsertFeature(IFeatureClass pFeatureClass, IGeometry pGeometry)
{
IFeatureBuffer pFeatureBuffer=null;
int typeFieldIndex = pFeatureClass.FindField("Layer");
pFeatureBuffer = pFeatureClass.CreateFeatureBuffer();
IFeatureCursor insertCursor = pFeatureClass.Insert(true);
pFeatureBuffer.set_Value(typeFieldIndex, "ZBTZ");
pFeatureBuffer.Shape = pGeometry;
insertCursor.InsertFeature(pFeatureBuffer);
}
程序调试时,每次到 pFeatureBuffer.Shape = pGeometry;这里就报错“这个集合中找不到此项目。”,pGeometry明明不是null啊.求高手解答啊。困扰好久了。很郁闷。