void clPlot::DrawLegend(CDC * dc)
{
CPen pen(PS_SOLID,0,RGB(0,0,0));
CPen *old = dc->SelectObject(&pen); dc->Rectangle(m_legendRect);
dc->Rectangle(m_legendRect_two);
dc->Rectangle(m_legendRect_thr);
dc->Rectangle(m_legendRect_four);
dc->Rectangle(m_legendRect_five); for(int i=0;i<17;i++)
{
CPen pen1(m_primarylegends[i].m_istyle, 1, m_primarylegends[i].m_color);
CPen *oPen = dc->SelectObject(&pen1);
dc->MoveTo(lLengendCoordinate[i][0],lLengendCoordinate[i][2]);
dc->LineTo(lLengendCoordinate[i][1],lLengendCoordinate[i][2]); CString tempone;
tempone.Format("%d",left_right_edge[i][0]);
CString temptwo;
temptwo.Format("%d",left_right_edge[i][1]); CString temp_str=tempone +"            "+DrawSerie[i].m_szTitle +"           "+ temptwo;
dc->TextOut(lLengendCoordinate[i][3],lLengendCoordinate[i][4],temp_str); pen1.DeleteObject();
dc->SelectObject(old);

}//追踪到这儿提示错误
dc->SelectObject(old);
}