C++/VB - Intellipoint (iPoint) driver seems to break GDI+ drawing

Asked By noma
20-May-08 04:28 AM
[Inadvertantly originally posted to
microsoft.public.win32.programmer.directx.graphics]

While trying to debug the cause of some customer complaints involving
overpainted windows and image flickering, I wrote a simple MFC test app that
opens a document window (derived from CFrameWnd), which contains a single
view (derived from CView). It also creates a single floating tool window
(derived from CDialog, with the WS_EX_TOOLWINDOW style set).

If one launches the app, places the tool window over the document window,
then begins resizing the document window or moving the main frame window
around underneath the tool window, eventually the contents of the tool window
are filled with the contents of the document window. In addition, the
contents of the document window will be shifted and split, as though the
clipping region or the drawing coordinates had been incorrectly shifted.

Using msconfig, I eventually found that the Intellipoint mouse driver,
ipoint.exe, seems to be the cause of this problem. If the driver is disabled,
or if version 5.5 or earlier of the driver is installed, the problem goes
away.

The drawing code in my test app is in the local view class's implementation
of OnDraw(), and looks like this:

void CIntellipointView::OnDraw(CDC* pDC)
{
CIntellipointDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;

/*
Draw some simple shapes.
*/
CRect clientRect;
this->GetClientRect(&clientRect);

Graphics g(*pDC);
int r;
int i;

for (i = 0; 100 > i; ++i)
{
Rect frame;

r = (rand() * 100) / RAND_MAX;

frame.X = (rand() * clientRect.Width()) / RAND_MAX;
frame.Y = (rand() * clientRect.Height()) / RAND_MAX;
frame.Height = r;
frame.Width = r;

Color col((rand() * 255) / RAND_MAX, (rand() * 255) / RAND_MAX,
(rand() * 255) / RAND_MAX);

SolidBrush b(col);

g.FillEllipse(&b, frame);
}
}

If I replace this code with with GDI code (creating CBrush and CPen objects
and selecting them into *pDC, and then using CDC::Ellipse() instead of
Graphics::FillEllipse()), the problem also vanishes. So, apparently, there's
some kind of strange interaction going on between the ipoint.exe driver and
the Graphics object wrapping the HDC.

The problem is 100% reproducible, on any XP or Vista system. I don't think
I'm doing anything strange here, but if somebody thinks otherwise, let me
know. Otherwise, I think this could well be the problem that a lot of people
have been complaining about involving the ipoint.exe driver.

Does anyone see that I'm doing anything wrong?
Vista
(1)
XP
(1)
CIntellipointView
(1)
CIntellipointDoc
(1)
GetClientRect
(1)
CFrameWnd
(1)
ClientRect.Height
(1)
ClientRect.Width
(1)
  Anagram replied...
19-Jun-08 06:56 PM
I just now came to this newsgroup to find information about this same
bug.  I haven't been following the discussions about it, so anything I
say might have already been said.

The two main symptoms I see are painting at inappropriate times and using
wrong coordinates.  Both symptoms don't always happen together.  I don't
know whether it only happens with GDI+.  One way to demonstrate the
inappropriate paint symptom is to play Freecell.  Around five seconds
after an appropriate repaint of the Freecell window, it does the
inappropriate paint, and you can see the Freecell window flicker.  But
the coordinate bug doesn't show there.  In Freecell, as everywhere, it
only happens when ipoint.exe is running.

I'm using Lispworks and accessing GDI+ via the Lispworks foreign function
interface.  So it has nothing to do with the programming language you're
using or anything related to it.  I'm using the flat GDI+ API.

When wrong coordinates are used, the clipping region is still correct.
Also, I only see the wrong coordinate symptom when drawing text, but that
may be just because that's what I happen to be looking at then.

It actually does two inappropriate paints, one right after the other.
Both of them are roughly five seconds after the appropriate paint.  The
wrong coordinates are different in the two inappropriate paints.

This is probably two bugs working together.  One in ipoint.exe and one in
GDI+.
help
MSVCRT differnet in Vista C++ / VB I am upgrading to Vista but still support some VB6 application. If I Package (Visual Studio package and deploy) my applications in XP they work across 2000, XP, Vista and 7. But if I Package them under Vista I get an "unable to find entry point " in the MSVCRT.dll when installing on 2000 or XP machines. Under windows 2000 and XP it appears this DLL only had handlers 1 and 2 but in Vista it has
in wincore.cpp This line appears higher up the call stack - I am using windows vista, that may be relevant. HRESULT hr = (static_cast<IFileDialog*> (m_pIFileDialog))-> Show(m_ofn.hwndOwner); I have also wrong or what I can try to stop the crash? Liam VC MFC Discussions Windows Vista (1) Vista (1) XP (1) CFileExceptionDialog (1) LFSoftDev (1) FileNameMaxLength (1) NumberOfFileNames (1) CallWindowProc (1) Please post some code with a previous version of VS, I think that MFC does not support the new Vista-style dialogs; e.g. consulting MSDN documentation for CFileDialog constructor in VS2005, shows that the 80).aspx Moreover, if you are using VS2008, make sure that you enabled the new Vista features, properly #define'ing preprocessor macros like WINVER to 0x0600 (Windows Vista is "Windows 6" in their internal numbering system) in HTH, Giovanni Thank you for your I do this though, will I still be able to run the compiled application using XP? Liam OK I believe that the VS2008 wizard for MFC dialog-based apps writes out
Microsoft Windows Vista includes a two-way firewall. TO THE TOP C++ / VB Some of us want to a good free easy to use two-way FireWall like ZoneAlarm that's compatible with Vista? Thanks. http: / / www.vistastic.com / 2007 / 03 / 09 / windows-firewall-enable-outbound-filtering / I bet you didn't know that Microsoft Windows Vista includes a two-way firewall. Unfortunately, the outbound filtering has been disabled. I'm not Microsoft not wanting to frustrate customers when their internet dependent applications suddenly stopped working. Windows Vista Firewall: How To Turn On Outbound Filtering * Click the Start Button (Windows Orb) * In the properties you can also configure additional rules for incoming as well as outbound connections. VB Vista Compatibility Discussions ZzzzzZZZZZZZZZZZ (1) SQL Server (1) MySQL (1) Windows XP (1) Windows Vista (1) Adobe (1) SMTP (1) RFCs (1) You are not going to find anything better than the Vista FW and Vista in itself due to the advanced features the FW and Vista are
No textures with D3DPOOL_MANAGED under Vista? C++ / VB Hello, does anybody know if there are general problems creating textures with D3DPOOL_MANAGED attribute under Vista? With XP, all runs as expected. The same code and very similar graphics hardware / driver (ATI HD38xx series, 512MB Video RAM) under Vista cause an error, meanwhile D3DPOOL_DEFAULT works. HRESULT hRet = D3DXCreateTexture(m_pD3DDevice / *valid D3D9 oder D3D9Ex Device only top level* / , 0 / *usage* / , D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &pTexture); D3DERR_INVALIDCALL is returned only when running under vista All hints are very much appreciated. Thanks! Robert Win32 DirectX Graphics Discussions Windows XP (1) Windows Vista (1) SetGPUThreadPriority (1) Surface (1) Vista (1) D3DXCreateTexture (1) XP (1) Direct3D9Ex (1) Try the D3D9 samples on that system. Might
Vista Magnification API: MagSetImageScalingCallback() doesn't work? C++ / VB Hi, I am able to succesfully call Are there any sample how to use custom MagImageScalingCallback function? Or is this part of Vista magnification API simply broken? Or is it that this functionality is not implemented in all WDDM drivers? - - Grzegorz Wróbel 677265676F727940346E6575726F6E732E636F6D Win32 Kernel Discussions Windows XP (1) Windows Vista (1) WNDOBJs (1 Vista (1) MagSetImageScalingCallback (1) MagSetWindowFilterList (1) WPF (1) MagImageScalingCallback (1) Well, calling MagSetWindowSource() *before* MagSetImageScalingCallback() makes data, however it still gets called only once. - - Grzegorz Wróbel 677265676F727940346E6575726F6E732E636F6D The MagXXX APIs in Vista are meaningful only when milcore.dll is being used to produce a magnified view of http: / / www.microsoft.com / info / cpyright.htm In the "debug version" I do have the Vista magnification control visible on the screen. The successfully registered callback is called only once (or on some machines not at all). Since it was hard to believe that some Vista APIs might be broken, I thought that maybe it is that my graphic drivers that