32767 Limit with CDC Drawing Functions?

Dear Dr. GUI:

We have an application which makes extensive use of the CDC class. The functions work very well until we start passing values greater than 32767. Most member functions are passed ints, which presumably should be longs in Windows NT and Windows 95. The problem is that, although the application works perfectly normally in Windows NT, it goes alarmingly wrong in Windows 95 and Win32s after the 32767 limit. Although, with a serious amount of work (involving factoring EVERY value we send to any CDC function) we can get around this problem, it would be nice if all systems worked anyway.

Do you have any suggestions?

Cheers,

Pete Callaway

Dr. GUI replies:

Ah! A traditional Windows SDK question, at last.

This isn't terribly well covered in the MFC documentation, so it falls to Dr. GUI to deliver some bad news: Under Windows 95 and Win32s, all screen coordinates are limited to 16 bits (–32768 to 32767). For performance, compatibility, and memory footprint reasons, Windows 95 and Win32s use a lot of 16-bit code. For efficiency's sake, that necessitates using 16-bit values for coordinates.

Because of this, you're going to have to scale your coordinates to the required range.

Sorry the news isn't better.