?
Solved

pDoc->UpdateAllViews(NULL) problem

Posted on 2004-04-27
6
Medium Priority
?
793 Views
Last Modified: 2013-11-20
Hello,

I have a program where I load a bitmap and draw some lines. When I put the 'pDoc->UpdateAllViews(NULL) ' in de Draw function or somewhere else(because some lines need to be redrawn), My program crashes. Does somebody know what the cause can be when a program crashes when putting this statement in your code?

Herman
0
Comment
Question by:Hermy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 14

Accepted Solution

by:
wayside earned 50 total points
ID: 10930061
There's lots of reason why it could crash.

You need to tell us exactly where it crashes, and post some code of your code where the crash happens.

Otherwise it's impossible to say.
0
 
LVL 1

Assisted Solution

by:Lara_tin2
Lara_tin2 earned 100 total points
ID: 10945096
Please DONT put updateAllViews in onDraw function or any sub routinue call by it.
updateAllViews cause Window redraw==>call onDraw==>updateAllViews is called more...
your Windows'll be Draw everytime and get all system  resource
and so on.may be it is reason
0
 

Author Comment

by:Hermy
ID: 10946981
I know where the problem is, still not knowing what to do with it. It's a little undoable to post a lot of code. I used rational purify to see what is wrong. I get red errors on some CList list fucntions after loading my bitmap.
0
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 100 total points
ID: 11072201
This is conclusive that you can not put UpdateAllViews inside your OnDraw function.
Also inside all view functions, don't use UpdateAllView, simply call RepaintWindow() or Invalidate(TRUE).
UpdateAllView is designed to be called from document functions, and from app functions.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11857831
still awaiting for author feedback
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question