ts_chen

why I can't read point data from polyline

Discussion created by ts_chen on Oct 28, 2012
Latest reply on Nov 13, 2012 by developer@sigmacubed.com
I write an ATL project like logomarkersymbol. I want to read polyline data in Draw function , I use IPointCollectionPtr to read, but failed, the pointcollection is empty. Why???

my code is :

IPolylinePtr spPolyline(Geometry);
           IGeometryCollectionPtr spGeometryCollection(spPolyline);

if(NULL == spGeometryCollection)
  return E_FAIL;

long nGeos=0;
spGeometryCollection->get_GeometryCount(&nGeos);

for (i=0;i<nGeos;i++)
{
  IGeometryPtr spGeometry;
  spGeometryCollection->get_Geometry(i, &spGeometry);
  IPointCollectionPtr spCollection(spGeometry);

  long nPoints=0;
  nPoints = spPointCollection->get_PointCount(&nPoints);

                      //spPolyline, spGeometry and spPointCollection has values, but npoint is empty. why???
                      ??????  
             }

Outcomes