943,861 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2330
  • C++ RSS
Mar 9th, 2007
0

Visual c++.net MFC question

Expand Post »
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
Last edited by ~s.o.s~; Mar 10th, 2007 at 11:25 pm. Reason: Added code tags, learn to use them.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RossSCann is offline Offline
17 posts
since Jan 2007
Mar 9th, 2007
0

Re: Visual c++.net MFC question

>>Any thoughts?

Nope, since you didn't post any relevant code.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Mar 10th, 2007
0

Re: Visual c++.net MFC question

>>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
Last edited by ~s.o.s~; Mar 10th, 2007 at 11:25 pm. Reason: Added code tags, learn to use them.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RossSCann is offline Offline
17 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: sugestion for a project on c
Next Thread in C++ Forum Timeline: wireless network programming in c++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC