0

Does anyone use MFC?
I have a problem executing graphics functions.

void CMainFrame::OnTimer(UINT idEvent)
{
idEvent++;         //when a time event occurs do some         
pointG2.y-=3;            //graphics
pointG=pointG2;
TimerEvent();
InvalidateRect(NULL, TRUE); //to call OnDraw
}
 
void Csail_boatView::OnDraw(CDC* pDC)
{
   //graphics functions here
   //they compile OK
   //OnDraw is called by the even timer above
   //the graphic funtions fail to work
 
}

Any thoughts?
Ross

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by RossSCann
0

>>Any thoughts?

Nope, since you didn't post any relevant code.

void CMainFrame::OnTimer(UINT idEvent)
{
idEvent++;
pointG2.y-=3;
pointG=pointG2;
TimerEvent();
InvalidateRect(NULL, TRUE);
}
 
void Csail_boatView::OnDraw(CDC* pDC)
{
 
  pDC->MoveTo(pointG); //example fn of many
  CPoint pt2;               //they execute fine when OnDraw
  pt2.x=xb-x;              //is called at window creation
  pt2.y=yb+3*x;
  pDC->LineTo(pt2);   //they don't work when OnDraw is
                             //called by the OnTimer event above 
 
}

Ross

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.