Hey,
I am trying to add a pointcollection into a feature class using the IEnumVertex2 interface. When I try to instantiate the enumVertex, I get the loader lock error. Here are some code snippets:
IMultipoint pMultiPoint;
pMultiPoint = new MultipointClass();
IPointCollection5 pPointCollection;
pPointCollection = (IPointCollection5)pMultiPoint;
//I add some points to the point collection
IGeometryBridge2 gBridge = new GeometryEnvironmentClass();
gBridge.AddPoints(pPointCollection, ref pPoint);
// it dies here with a loader lock error -- the pIEnumVertex is null.
IEnumVertex2 pIEnumVertex = (IEnumVertex2)pPointCollection.EnumVertices;
IPoint queryVertex = new PointClass();
int pIndex;
int vertIndex;
IPoint outVertex;
pIEnumVertex.Next(out outVertex, out pIndex, out vertIndex);
Any ideas what is going wrong? What is the best way to place a point collection into a feature class?
Thanks, Chris