• <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消息  回復  更多評論
              

            色综合久久88色综合天天| 久久午夜夜伦鲁鲁片免费无码影视 | 色欲久久久天天天综合网精品| 亚洲AV日韩AV天堂久久| 91久久精品电影| 2021久久精品免费观看| 国产精品9999久久久久| 思思久久99热免费精品6| 99久久免费国产精精品| 亚洲欧洲精品成人久久曰影片| jizzjizz国产精品久久| 中文字幕精品久久久久人妻| 久久九九亚洲精品| 无码人妻久久久一区二区三区| 国产精品女同一区二区久久| 人妻精品久久无码区| 欧美激情精品久久久久久| 久久国产精品成人片免费| 久久无码中文字幕东京热| 久久福利片| 精品99久久aaa一级毛片| 好久久免费视频高清| 日韩乱码人妻无码中文字幕久久| 久久国产精品一区| 精品久久久久久无码中文字幕| 久久国产精品无码HDAV| 久久偷看各类wc女厕嘘嘘| 亚洲精品无码久久久影院相关影片| 亚洲精品NV久久久久久久久久| 精品久久久久久无码免费| 国产精品久久久99| 国产午夜电影久久| 国内精品免费久久影院| 久久国产免费直播| 欧洲性大片xxxxx久久久| 精品久久久久久无码中文字幕| 国产精品99久久不卡| 久久精品国产只有精品66| 久久久久国产精品麻豆AR影院| 日韩中文久久| 亚洲人成伊人成综合网久久久|