SetScrollSizes
-
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
-
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
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:
-
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:
Isn't it amazing (and humiliating ! ) how obvious something really is when someone else points it out !!! :laugh: Thanks Mark ! :sigh:
Doug
-
Isn't it amazing (and humiliating ! ) how obvious something really is when someone else points it out !!! :laugh: Thanks Mark ! :sigh:
Doug
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: