ScrollBar bugs in XP?

  • Thread starter Thread starter Dr. Kato
  • Start date Start date
D

Dr. Kato

I believe I have found a bug in XP, but it seems so bad
that it isn't even possible, so I am hoping some folks
here can help me verify or dispute it, which in the end
will benefit us all. Here is the deal.

I have created a simple MFC test app as such. Using the
new project wizard, create an MFC dialog based app using
MFC statically. Being a dialog and using MFC statically
are the only changes from the default app wizard settings
that you will have to make. Next in the resource editor,
grab a horizontal scrollbar and place it in the dialog. I
made mine at the bottom and about the width of the
dialog. Right click on the scrollbar and choose add
variable from the contextual menu. Make sure the variable
is a control type of CScrollBar. Now, in your dialogs
OnInitDialog call add the following lines:

// TODO: Add extra initialization here
SCROLLBARINFO sbi;
DWORD error = 0;

memset(&sbi, 0, sizeof(SCROLLBARINFO));
sbi.cbSize = sizeof(SCROLLBARINFO);
BOOL success = ::GetScrollBarInfo(m_ScrollBar.GetSafeHwnd
(),
OBJID_CLIENT, &sbi);

if(!success)
error = ::GetLastError();

Where m_ScrollBar is the variable you added. Lastly
before you build, make sure you add WINVER=0x500 to the
preprocessor line of your project's settings. Now build
and set a breakpoint at GetScrollBarInfo. When you stop
on this breakpoint, step over and see if the sbi variable
gets filled in. If not, see what GetLastError returns.
For me, it return -1, which no sense whatsoever. Now, it
might be hard to do, but if you can, take this exact same
code to a W2K machine and run it in the same fashion.
When you step over the breakpoint, is the structure now
filled in? For me it was, and it behaved as expected. For
more fun and giggles, I created two message boxes, one
for success and one for failure, and built the app on
W2K. First I verified that the success message box came
up on W2K. Then I took just the binary over to XP, and
sure enough the failure message box came up. The only
difference then was the version of User32.dll.

So that is the problem. The same scenario held true for
the function GetScrollInfo. This of course seems
impossible, as a number of applications would be broken,
would they not. Regardless, my first thougt was that
maybe the size element wasn't right, and that maybe the
structure had a compile-switched element in it, but in
looking at it, the sturcture had no such switch. So what
gives? Have I really found such a blatant bug? You can
help us all get to the bottom. Please help.

Thanks,
David Sumich
Digidesign - A Division of Avid
 
Hi Dr.Kato,

Thanks for posting in the group!

I build a test project(follow the steps you posted) under Windows2000 SP4
and WindowsXP Profession2002 SP1 with VC7.1, and it works OK under both
platforms.

So what's your Windows OS version? Maybe the problem that you described has
already been covered with the latest Service Packs.


Best regards,
Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Hi Dr.Kato,

Thanks for your quickly reply!

Now I can repro the problem under VC7.0 in Windows XP platform.
It seem a issue to the VC7.0, I will report this problem to the product
team.

Thanks again for your concern on VC7.0.


Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Hello David,

This is a confirmed bug in VS.NET 2002 and has been fixed in VS.NET 2003.

Thanks very much for your feedback. :)

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top