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. C / C++ / MFC
  4. OnDraw not getting called

OnDraw not getting called

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelpquestion
6 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
    mcguile257
    wrote on last edited by
    #1

    I have my CEditorView class, which is derived from CRichEditView. I put a breakpoint in my CEditorView::OnDraw function and it was never getting called. Why is OnDraw not getting called? Reason is, I want to be able to draw the line numbers and a margin, but I can't now that OnDraw is not getting called? Any help is appreciated!!

    A N 2 Replies Last reply
    0
    • M mcguile257

      I have my CEditorView class, which is derived from CRichEditView. I put a breakpoint in my CEditorView::OnDraw function and it was never getting called. Why is OnDraw not getting called? Reason is, I want to be able to draw the line numbers and a margin, but I can't now that OnDraw is not getting called? Any help is appreciated!!

      A Offline
      A Offline
      AlexO
      wrote on last edited by
      #2

      is it virtual? What is the signature of CEditorView::OnDraw ?

      M 1 Reply Last reply
      0
      • A AlexO

        is it virtual? What is the signature of CEditorView::OnDraw ?

        M Offline
        M Offline
        mcguile257
        wrote on last edited by
        #3

        The definition for CEditorView::OnDraw is: virtual void OnDraw( CDC *pDC );

        A 1 Reply Last reply
        0
        • M mcguile257

          The definition for CEditorView::OnDraw is: virtual void OnDraw( CDC *pDC );

          A Offline
          A Offline
          AlexO
          wrote on last edited by
          #4

          Sorry - had to ask:). I think problem is the following void CCtrlView::OnPaint() { // this is done to avoid CView::OnPaint Default(); } Default - is just a call to default winproc, instead of CView call to OnDraw(&dc);

          M 1 Reply Last reply
          0
          • A AlexO

            Sorry - had to ask:). I think problem is the following void CCtrlView::OnPaint() { // this is done to avoid CView::OnPaint Default(); } Default - is just a call to default winproc, instead of CView call to OnDraw(&dc);

            M Offline
            M Offline
            mcguile257
            wrote on last edited by
            #5

            OK, where is CCtrlView? Do I have to call Default to avoid this problem? I appreciate your responses, but I am a little confused about how to fix this with your current reply.

            1 Reply Last reply
            0
            • M mcguile257

              I have my CEditorView class, which is derived from CRichEditView. I put a breakpoint in my CEditorView::OnDraw function and it was never getting called. Why is OnDraw not getting called? Reason is, I want to be able to draw the line numbers and a margin, but I can't now that OnDraw is not getting called? Any help is appreciated!!

              N Offline
              N Offline
              Neville Franks
              wrote on last edited by
              #6

              Looking at the class def for CRichEditView there is no virtual OnDraw() function. I've never used CRichEditView but I assume it is quite different to other CView derived classes. I suggest you have a look at some of the articles here on CP that use CRichEditView and see how they go about any drawing of there own. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com

              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