pDoc->UpdateAllViews(NULL) problem

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
HermyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
waysideConnect With a Mentor Commented:
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
 
Lara_tin2Connect With a Mentor Commented:
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
 
HermyAuthor Commented:
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
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
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
 
Jaime OlivaresSoftware ArchitectCommented:
still awaiting for author feedback
0
All Courses

From novice to tech pro — start learning today.