Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VC++ force redraw

Options
  • 16-03-2002 5:11pm
    #1
    Registered Users Posts: 310 ✭✭


    Lo,

    I creating a VC++ app using MFC. So I have among other classes, the doc class and the view class. My problem is this. When the application starts it draws my stuff (graphics I have defined in my doc class) on the client area. But I can't for the life of me figure out out to update the view after this process. When I change a certain part of the data that the grpahics use I can't seem to get the changes reflected in the screen. Obviously i need to call my view classes onDraw function but this takes a pointer to a CDC object. I don't know how to get a pointer to the view object from my doc object. I thought there was a function like Invalidate() or Update() that I can call from the doc object but they don't seem to work. This has to be easy to do. I know how to do it in ordinary VC++ (not using MFC). The only books I have are them useless * in 21 days book. MSDN is not very helpful either although I am still searching there. This has to be easy to do?? I was thinking about creating a member variable of type CDC in the Doc object and have the view object set this to the correct pointer to the device context when it draws the first time around but there has to be an easier way to do it. Any help appreciated.


Advertisement