Solved

pDoc->UpdateAllViews(NULL) problem

Posted on 2004-04-27
6
760 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 49
Process filename extension 3 187
sum28 challenge 31 112
withoutTen challenge 14 123
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 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