高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】odamfcapp and m-pdevice-update
odamfcapp and m_pdevice->update
odamfcapp and m_pdevice->update
in the odamfcapp sample, a secondary thread is used to update the view. in the seconadry thread, the method cdwgviewer:: paint() calls m_pdevice->update(). i noticed that when handling the mouse wheel and zooming in or out, the call to m_pdevice->update() appears to return before the view is completely rendered. i know cdwgviewer::abortregen is posting a wm_close to the secondary thread to abort it, but i don't see how this causes m_pdevice->update to return prematurely. every time i call update() from my own code, it blocks until the rendering is completed.
why is the call to m_pdevice->update() in the odamfcapp sample returning before the view is completely rendered?
hi,
independently of that how many threads to use, update() implementation calls odgicontext::regenabort() in its internal circles to determine if user want to abort regeneration. in odamfcapp, cdwgviewer is a descendant of odgicontext and regenabort() is overridden (see cdwgviewer::regenabort()/dwgviewer.cpp, line 291).
thanks, i didn't realize regenabort() was virtual. now it makes perfect sense.
|