Possible bug with MFC7?

Hi all,

I have been writing an MFC SDI Doc/View app which makes use of the print preview facility provided. I have been experiencing some weird issues, so I decided to do a simple test.

I created a new empty project of the same type using the MFC app wizard. I then built and run this new default project without making any changes, and the same problem occurs here. Both of these projects are using Microsoft Visual Studio .NET Pro 2003.

I created the same default project using Visual C++ 5.0 Pro, and the problem does not exist. So it appears the bug is within the later version of the MFC library.

The Problem:
=========
When in print preview mode, when fully zoomed out the zoom cursor works correctly. When zoomed in to any amount the zoom cursor does not work correctly.

When moved to the right side of the page layout, the cursor reverts back to the default arrow cursor, and clicking has no effect on the zoom. When the cursor is moved to the left of the view (i.e. where there is dark grey area to left of page) the cursor changes to the zoom cursor.

This is clearly a problem, but is it just me experiencing this? Does anybody know a way around this issue?

Many thanks,
Lea Hayes
[1265 byte] By [lhayes00] at [2007-11-19 22:59:30]
# 1 Re: Possible bug with MFC7?
Yes, it is a bug.
Print preview window is trying to determine if position of the mouse cursor is inside of the page. Calculation use GetDeviceScrollPosition member of the scroll view that returns value that does not take into account that page is centered in the client area.
That is why view magnifying glass cursor changes to are shifted to the left.

Resize frame to the point that page takes all width of the client and see where cursor changes.

I think that the only way to get around it, (from the top of my head) is to derive own class from CPreviewView and instead relying on the CScrollView calculations write correct code for determining page area.
JohnCz at 2007-11-10 23:32:32 >
# 2 Re: Possible bug with MFC7?
Hi,

I have put a bug report on the Microsoft Connect site at the following location. If possible could people who have come across this bug validate the bug request?

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=144833

Many thanks,
Lea Hayes
lhayes00 at 2007-11-10 23:33:32 >