troubleshooting Question

Adding Object to CObArray

Avatar of PhillO
PhillOFlag for Australia asked on
System Programming
3 Comments1 Solution745 ViewsLast Modified:
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);****

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros