Link to home
Start Free TrialLog in
Avatar of PhillO
PhillOFlag for Australia

asked on

Adding Object to CObArray

I keep getting the following error when i compile my code and am not sure how to fix it

.... error C2664: 'CObArray::Add' : cannot convert parameter 1 from 'CPolyline *' to 'CObject *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

I have a CPolylineArray class that extends CObArray class

This is the offending bit of code. I have a sample bit of code from my lecture and this seems to match apart from the fact that his compiles and mine does not??!!

void CPolylineArray::AddPolyline(void)
{
      CPolyline* pActivePolyline = new CPolyline();
***      Add(pActivePolyline);****
}
ASKER CERTIFIED SOLUTION
Avatar of bastibartel
bastibartel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PhillO

ASKER

Sebastian

you are dead right!!

Thanks
Avatar of bastibartel
bastibartel

:-)