Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. why ATL based ACTIVEX control got flicker when Redraw

why ATL based ACTIVEX control got flicker when Redraw

Scheduled Pinned Locked Moved ATL / WTL / STL
c++comsysadminhardwaretutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    max_xiayi
    wrote on last edited by
    #1

    Hi,All,I am developing an ACTIVEX control embedded in IE, which is used to display continuous jpegs captured from a server.Firstly I wrote my ACTIVEX control in MFC,and call InvalidateControl() to realize control window redraw.It is ok.Then I rewrote my ACTIVEX in ATL,most of the code regards to grapic are same,but this time since InvalidateControl() can not be called in ATL based control, I call FireViewChange() to realize control window redraw time by time.However,I found that the control window got flicker when it is redraw.What happened and how to deal with? please contact: max_xiayi@hotmail.com

    T 1 Reply Last reply
    0
    • M max_xiayi

      Hi,All,I am developing an ACTIVEX control embedded in IE, which is used to display continuous jpegs captured from a server.Firstly I wrote my ACTIVEX control in MFC,and call InvalidateControl() to realize control window redraw.It is ok.Then I rewrote my ACTIVEX in ATL,most of the code regards to grapic are same,but this time since InvalidateControl() can not be called in ATL based control, I call FireViewChange() to realize control window redraw time by time.However,I found that the control window got flicker when it is redraw.What happened and how to deal with? please contact: max_xiayi@hotmail.com

      T Offline
      T Offline
      Todd Smith
      wrote on last edited by
      #2

      FireViewChange() calls InvalidateRect with bErase=TRUE. You'll need to write your own FireViewChange() and pass FALSE for bErase. inline HRESULT CComControlBase::FireViewChange() { if (m_bInPlaceActive) { // Active if (m_hWndCD != NULL) ::InvalidateRect(m_hWndCD, NULL, TRUE); // Window based else if (m_spInPlaceSite != NULL) m_spInPlaceSite->InvalidateRect(NULL, TRUE); // Windowless } else // Inactive SendOnViewChange(DVASPECT_CONTENT); return S_OK; } Todd Smith

      G 1 Reply Last reply
      0
      • T Todd Smith

        FireViewChange() calls InvalidateRect with bErase=TRUE. You'll need to write your own FireViewChange() and pass FALSE for bErase. inline HRESULT CComControlBase::FireViewChange() { if (m_bInPlaceActive) { // Active if (m_hWndCD != NULL) ::InvalidateRect(m_hWndCD, NULL, TRUE); // Window based else if (m_spInPlaceSite != NULL) m_spInPlaceSite->InvalidateRect(NULL, TRUE); // Windowless } else // Inactive SendOnViewChange(DVASPECT_CONTENT); return S_OK; } Todd Smith

        G Offline
        G Offline
        greekgoddj
        wrote on last edited by
        #3

        Having the same problem here. I have tried the above suggestion but it has not worked. I still get flickering. I have also user temporary DC buffer to do all the drawing onto before copying the buffer to the final output in one step. Anybody come up with another way arround this? Thanks, Aristotel :^)

        G 1 Reply Last reply
        0
        • G greekgoddj

          Having the same problem here. I have tried the above suggestion but it has not worked. I still get flickering. I have also user temporary DC buffer to do all the drawing onto before copying the buffer to the final output in one step. Anybody come up with another way arround this? Thanks, Aristotel :^)

          G Offline
          G Offline
          greekgoddj
          wrote on last edited by
          #4

          Anyone? :^)

          G 1 Reply Last reply
          0
          • G greekgoddj

            Anyone? :^)

            G Offline
            G Offline
            greekgoddj
            wrote on last edited by
            #5

            Ok...quite embarrasing but basically I had forgotten to add MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd) So onEraseBkgnd was not being called at all. Silly me... :~

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups