Solved

Can the CArray class be used with the function Polyline?

Posted on 2002-07-28
4
295 Views
Last Modified: 2013-11-20
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?
0
Comment
Question by:Alberto071397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 7183924
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.
0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 7183928
PS: The above is "CDC::Polyline()" - if you want to use the Win32 version, you would use

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

Author Comment

by:Alberto071397
ID: 7184170
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.
0
 
LVL 86

Expert Comment

by:jkr
ID: 7184187
>>CArray<CPoint, CPoint&> worked as well

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

Thank you!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 83
canBalance challenge 34 105
Sed question 2 123
I could not set window to top 4 42
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question