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. SetScrollSizes

SetScrollSizes

Scheduled Pinned Locked Moved C / C++ / MFC
4 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.
  • S Offline
    S Offline
    Still learning how to code
    wrote on last edited by
    #1

    As I am using CScrollView in my application, I have called SetScrollSizes() in my override of OnInitialUpdate(). However, I get an assertion when I check the mapping mode. The code is as below:- SetScrollSizes(MM_LOMETRIC,TotalSize); CDC* pDC; pDC = GetDC(); int iMapMode; iMapMode = pDC->GetMapMode(); ASSERT(iMapMode == MM_LOMETRIC); I'm sure that there is a simple answer to this !!! :confused:

    Doug

    M 1 Reply Last reply
    0
    • S Still learning how to code

      As I am using CScrollView in my application, I have called SetScrollSizes() in my override of OnInitialUpdate(). However, I get an assertion when I check the mapping mode. The code is as below:- SetScrollSizes(MM_LOMETRIC,TotalSize); CDC* pDC; pDC = GetDC(); int iMapMode; iMapMode = pDC->GetMapMode(); ASSERT(iMapMode == MM_LOMETRIC); I'm sure that there is a simple answer to this !!! :confused:

      Doug

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Probably because iMapMode != MM_LOMETRIC for your freshly obtained client DC. There's no reason iMapMode == MM_LOMETRIC unless you set the mapping mode to MM_LOMETRIC for the DC. This will be done for you in the CPaintDC that is passed to the OnDraw() method of the view class, so there your assert should succeed. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      S 1 Reply Last reply
      0
      • M Mark Salsbery

        Probably because iMapMode != MM_LOMETRIC for your freshly obtained client DC. There's no reason iMapMode == MM_LOMETRIC unless you set the mapping mode to MM_LOMETRIC for the DC. This will be done for you in the CPaintDC that is passed to the OnDraw() method of the view class, so there your assert should succeed. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        S Offline
        S Offline
        Still learning how to code
        wrote on last edited by
        #3

        Isn't it amazing (and humiliating ! ) how obvious something really is when someone else points it out !!! :laugh: Thanks Mark ! :sigh:

        Doug

        M 1 Reply Last reply
        0
        • S Still learning how to code

          Isn't it amazing (and humiliating ! ) how obvious something really is when someone else points it out !!! :laugh: Thanks Mark ! :sigh:

          Doug

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Heh - nah it's not that obvious....The docs aren't real clear on this if I remember right. The source code is better documentation. :) Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          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