Solved

ScrollView limitations

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now