• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            love in C++, live on MFC

            to get ready...

            C++博客 首頁 新隨筆 聯系 聚合 管理
              47 Posts :: 0 Stories :: 97 Comments :: 0 Trackbacks
            在mfc的group上有這樣一個問題:(http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.vc.mfc&mid=1aa1eddf-7bcf-407b-84fe-234fe0975331&sloc=en-us
            I?need?to?update?one?class?data?and?the?view?during?the?idle,?I?used?this??
            method?
            in?the?Cdoc:
            void?CMyAppDoc::OnIdle(){

            ????theClass
            ->
            Update();
            ????POSITION?pos?
            =
            ?GetFirstViewPosition();
            ????CView
            *?pView?=
            ?GetNextView(pos);
            ????pView
            ->Invalidate(true
            );
            ????pView
            ->
            UpdateWindow();????
            }


            It?works?only?when?I?move?the?mouse,?what
            's?wrong??Z_Z
            這個問題的確比較搞,要好好看mfc源碼的,下面是我的回答
            Nothing is wrong, I can explain it? is by design.
            Please take a look at the source code of int CWinThread::Run(), in that function, IsIdleMessage() is called, and in IsIdleMessage() WM_PAINT is ignored, which means WM_PAINT will not cause OnIdle to be called, for windows think it's just a WM_PAINT message and will not change the UI.
            Your UpdateWindow() only post a WM_PAINT message, the message queue is not empty but it's ignored by IsIdleMessage(), that's why.
            But when you move your mouse, the message queue is filled with some WM_MOUSEMOVE and it's not ignored for the position changes. So your OnIdle() is called again.
            -
            My suggestion is to move your Invalidate & UpdateWindow code to somewhere else.
            OnIdle()的確是個有點復雜的問題,我可能還會寫幾篇文章 :)
            這里(http://groups.google.com/group/microsoft.public.vc.mfc/browse_thread/thread/14f20aa5ffd6994d/66b6e5949a31bfa2?lnk=st&q=AfxUnlockTempMaps&rnum=40&hl=zh-CN#66b6e5949a31bfa2)有篇文章講的很到位
            posted on 2006-07-09 02:03 flyingxu 閱讀(1439) 評論(1)  編輯 收藏 引用 所屬分類: VC/MFCBug of Today

            Feedback

            # re: bug: OnIdle called only while mouse's moving 2006-07-09 13:39 LOGOS
            關于OnIdle()的事情我也經歷過.
            我那次將Ogre嵌入了MFC中,引擎的渲染調用放到OnIdle()中激活.
            起初無修改的情況下,需要不斷移動鼠標才能激活OnIdle()消息(有可能相反,因為我忘記了,不過問題確實存在).
            后來所做的修改是在自己實現的OnIdle()中返回TRUE,而不是返回父類OnIdle()的結果,就能連續不斷的產生IDLE消息  回復  更多評論
              

            国产毛片欧美毛片久久久| 一本色道久久88综合日韩精品| 亚洲一区精品伊人久久伊人| 久久午夜综合久久| 久久人妻少妇嫩草AV蜜桃| 久久精品夜夜夜夜夜久久| 丁香五月网久久综合| 一本一道久久精品综合| 亚洲国产精品嫩草影院久久| 久久久久人妻精品一区二区三区| 97r久久精品国产99国产精| 精品国产91久久久久久久a| 久久久久久久久久久精品尤物| 久久se精品一区二区| 欧美精品九九99久久在观看| a高清免费毛片久久| 久久只有这精品99| 国产精品亚洲美女久久久| 久久青青草原亚洲av无码app| 国内精品久久久久影院网站 | 久久国产精品99精品国产987| 99久久精品国产免看国产一区| 久久亚洲国产精品五月天婷| 国产一区二区精品久久| 午夜久久久久久禁播电影| 色播久久人人爽人人爽人人片aV| 久久久久久久综合日本亚洲| 国产69精品久久久久APP下载| 久久久久久毛片免费看| 久久久久免费精品国产| 久久w5ww成w人免费| 人妻少妇久久中文字幕| 久久精品亚洲AV久久久无码| 亚洲国产一成久久精品国产成人综合 | 久久无码专区国产精品发布 | 亚洲精品tv久久久久| 国产亚洲婷婷香蕉久久精品| 91精品国产综合久久婷婷| 97久久精品无码一区二区| 精品免费tv久久久久久久| 性欧美大战久久久久久久久|