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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Close a view during OnDraw

Close a view during OnDraw

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 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.
  • C Offline
    C Offline
    CodeBrain
    wrote on last edited by
    #1

    I have a question regarding the closing of a CView during a paint message. I want to send a close message to a view during its OnDraw(CDC*) method. Is it guaranteed that the OnDraw method will finish before the view processes the close message if I send it using PostMessage in my OnDraw code? Thanks in advance.

    M 1 Reply Last reply
    0
    • C CodeBrain

      I have a question regarding the closing of a CView during a paint message. I want to send a close message to a view during its OnDraw(CDC*) method. Is it guaranteed that the OnDraw method will finish before the view processes the close message if I send it using PostMessage in my OnDraw code? Thanks in advance.

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      Yes. PostMessage appends the message to the queue of posted messages. SendMessage waits for a response (turns into a recursive call on the same thread).

      C 1 Reply Last reply
      0
      • M Mike Dimmick

        Yes. PostMessage appends the message to the queue of posted messages. SendMessage waits for a response (turns into a recursive call on the same thread).

        C Offline
        C Offline
        CodeBrain
        wrote on last edited by
        #3

        OK, thank you. That was what I have expected.

        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