I am trying to create a custom class for a Uni assignment.
The class is inteded to hold a collection of points so it will draw a polyline ie a number of connected lines.
class CPolyline :
void AddPoint(CPoint* pPt);
CPtrArray m_points;//Collection of Point Objects
// Draws a complete polyline
void DrawPolyLine(CDC* pDC);
void CPolyline::AddPoint(CPoint* pPt)
void CPolyline::DrawPolyLine(CDC* pDC)//redraws a polyline
for (int i=0; i < m_points.GetCount(); i++)
******* pSegmentStart = m_points.GetAt(i-1); *******
******* pSegmentEnd = m_points.GetAt(i); *******
The Lines above denoted by ***etc are giving me compile errors
error C2440: '=' : cannot convert from 'void *' to 'CPoint *'
I have used CPtrArray because it works but why can't i use CObArray??
I am not very good at c++ programming and would appreciate some quick (and patient) responses