Solved

ScrollView limitations

Posted on 1998-02-04
5
446 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
string initialization in java 11 113
abstract class with all non abstract mentods 6 76
wordcount challenge 11 121
Excel file not created as expected 7 72
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

777 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