Solved

ScrollView limitations

Posted on 1998-02-04
5
458 Views
Last Modified: 2013-11-19
Hi,

My main view is derived from CScrollView. Basically this view consists of bitmaps which are added to the view at regular intervals using the MM_TEXT mapmode. This view is sized dynamically using the SetScrollSizes() member function.

The problem is: The view doesn't expand beyond 32768 pixels. This is probably a limitation of Scrollview. This means that the height of my view cannot exceed 32768 pixels.

I have to go beyond this limitation. Is there any easy solution using CScrollView??

Thanks
0
Comment
Question by:wpinto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1315607
CScrollView will not go beyond 32768 pixels not because of they are using short integers in the class. Rather, the basic problem is that the class relies on Windows to provide the features. However, Get and SetScrollPos() cannot take more than 32K values. Instead, Win32 programs should really use GetSetScrollInfo() which will work with more than 32K. You can create a new class derived from CView called CScrollView and copy most of the implementation over and instead of calling the 16bit scroll functions, use the 32bit ones instead.


0
 
LVL 2

Author Comment

by:wpinto
ID: 1315608
Hi thui,

Thats exactly what I tried to do. In fact CScrollView does call the 32 bit GetSetScrollInfo()... Where it fails is while converting logical points to device points LPtoDP when LP exceeds 32768. Is there some way to exceed this range for device coordinates in the 32 bit environment??

Thanks
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1315609
Are you using Windows 95? If so, then you're stuck because GDI is still 16 bits under Windows 95. If you're using NT though, things will work automatically. But if you need to get this to work under Win95, you'll have to do the work yourself.

Basically, you'll have to use the 16bits as an index into your real environment. For example, set up a logical area of 320,000 by 320,000 and to convert to the device units you divide by 10. So that the final device units can be represented in 16bits.


0
 
LVL 2

Author Comment

by:wpinto
ID: 1315610
Thanks for the info thui, I'll try it out.

...yes I am using Windows 95. Do you know if there's any such limitations on CListView. One of my options (apart from your suggested soln) is to replace the CScrollView with CListView. Will this work??

Thanks
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1315611
The limitation that exists is because of Windows 95. It does not matter which standard control you use, but if they don't do anything about using some mapping scheme, then you will have to do the work yourself. As far as I know, there isn't any such standard control.


0

Featured Post

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question