Link to home
Start Free TrialLog in
Avatar of Alberto071397
Alberto071397

asked on

Can the CArray class be used with the function Polyline?

It seems that the function Polyline doesn't accept as its first argument a CArray collection of CPoints. I wrote a program in which Polyline is used with a common array and it works fine, but if a CArray class is used instead, the program doesn't compile and gives the following message: cannot convert from 'class CArray<class CPoint,class CPoint &> *' to 'class CPoint *'.
Is there a way to make Polyline use the CArray class?
Avatar of jkr
jkr
Flag of Germany image

You can - if you use a CArray of POINT. E.g.

CArray<POINT, POINT> point_array;

// fill array

Polyline ( point_array.GetData(),point_array.GetSize());

"GetData()" will return a POINT* or LPPOINT respectively.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

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 Alberto071397
Alberto071397

ASKER

It wasn't necessary to use POINT; CArray<CPoint, CPoint&> worked as well. The trick is to use the member function GetData() to get a common array.
Thanks very much.
>>CArray<CPoint, CPoint&> worked as well

Both are in fact the same - CPoint is a very "thin" wrapper

Thank you!