ScrollView limitations

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
LVL 2
wpintoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tommy HuiEngineerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wpintoAuthor Commented:
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
Tommy HuiEngineerCommented:
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
wpintoAuthor Commented:
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
Tommy HuiEngineerCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.