void CArrtestView::OnDraw(CDC* pDC)
{
CArrtestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CString str1;
CArray<CPoint, CPoint> ptArray1;
CPoint pt1(10,20);
ptArray1.Add(pt1);
CPoint pt2(20,30);
ptArray1.Add(pt2);
ptArray1.Add(CPoint(30,40));
ptArray1.Add(CPoint(40,50));
CArray<CPoint, CPoint> ptArray;
ptArray.Add(CPoint(50,60));
ptArray.Append(ptArray1);
for(int i=0; i<ptArray.GetSize(); i++)
{
str1.Format("%d, %d", ptArray[i].x, ptArray[i].y);
pDC->TextOut(20, 20+i*25, str1);
}
ptArray.SetAt(3,CPoint(77,99));
str1.Format("%d, %d", ptArray.GetAt(3).x, ptArray.GetAt(3).y);
pDC->TextOut(100, 20, str1);
CArray<CString, CString> strArr;
strArr.Add("AAA");
strArr.Add("BBB");
strArr.Add("CCC");
for(int j=0; j<strArr.GetSize(); j++)
{
pDC->TextOut(20, 175+j*25, strArr.Get