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
Solved

pDoc->UpdateAllViews(NULL) problem

Posted on 2004-04-27
6
773 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
6 Comments
 
LVL 14

Accepted Solution

by:
wayside earned 25 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 50 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 50 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
difference between String.subString() and String.subSequence() 6 234
fizzArray2 challenge 1 90
abstract class with all non abstract mentods 6 80
Path of Workbook 3 86
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: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

856 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