• <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 閱讀(1450) 評論(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消息  回復  更多評論
              

            久久青青草原精品国产不卡| 久久精品www| 2021国内久久精品| 亚洲精品无码成人片久久| 国产精品久久久天天影视| 国产成人精品久久一区二区三区av | 久久久久久精品成人免费图片| 国产高潮国产高潮久久久91| 久久精品无码一区二区日韩AV| 狠狠色丁香久久婷婷综合_中| 国内精品久久久久影院一蜜桃| 久久99精品国产99久久| 色婷婷狠狠久久综合五月| 大伊人青草狠狠久久| 久久精品国产乱子伦| 国产亚洲精久久久久久无码AV| 中文字幕人妻色偷偷久久| 国产高潮久久免费观看| 99久久人妻无码精品系列| 久久婷婷五月综合成人D啪 | 伊人色综合久久天天网| 青青青伊人色综合久久| 精品久久久无码人妻中文字幕豆芽 | 久久人人爽人人爽人人片av高请| 久久本道久久综合伊人| 久久精品国产福利国产秒| 亚洲va国产va天堂va久久| 成人久久免费网站| 亚洲中文字幕无码久久综合网| 伊人色综合九久久天天蜜桃| 亚洲国产天堂久久久久久| 久久精品国产亚洲av瑜伽| 精品无码久久久久久久动漫| 国产精品久久久久乳精品爆| 亚洲国产二区三区久久| 久久e热在这里只有国产中文精品99 | 久久精品国产99国产精品导航 | 狠狠88综合久久久久综合网| 亚洲日韩中文无码久久| 精品久久人妻av中文字幕| 久久精品国产精品青草app|