这是在画直线
void CLlView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default CClientDC dc(this);
dc.MoveTo(m_orgpoint);
dc.LineTo(point);
CDrawLine *dl=new CDrawLine(m_orgpoint,point);
//m_array.Add(dl);
CLlDoc *pdoc = GetDocument();
pdoc->m_obary.Add(dl);
CView::OnLButtonUp(nFlags, point);
}
m_obary是CObArray变量,在文档类中定义的
編译时出现错误
error C2664: 'Add' : cannot convert parameter 1 from 'class CDrawLine *' to 'class CObject *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
void CLlView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default CClientDC dc(this);
dc.MoveTo(m_orgpoint);
dc.LineTo(point);
CDrawLine *dl=new CDrawLine(m_orgpoint,point);
//m_array.Add(dl);
CLlDoc *pdoc = GetDocument();
pdoc->m_obary.Add(dl);
CView::OnLButtonUp(nFlags, point);
}
m_obary是CObArray变量,在文档类中定义的
編译时出现错误
error C2664: 'Add' : cannot convert parameter 1 from 'class CDrawLine *' to 'class CObject *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货