[vtkusers] Issue with VTK and windows 64BIT
L.J. van Ruijven
L.J.vanRuijven at amc.uva.nl
Tue Dec 19 10:50:20 EST 2006
Hello David,
Class vtkWin32OpenGLRenderWindow reserves extra bytes in its window
class. I use vtkWndOffset as an offset into this buffer. Comming to
think of it, the change I mentioned must also be applied to class
vtkWin32OpenGLRenderWindow.
I did not save the original code, so I give you the places where
vtkWndOffset occurs in my current code. In class
vtkWin32OpenGLRenderWindow I use vtkWndOffset in the method WndProc in
the statement
vtkWin32OpenGLRenderWindow *me =
(vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(hWnd,vtkWndOffset);
in the method CreateAWindow in the statements
wndClass.cbWndExtra = 2 * vtkWndOffset;
vtkSetWindowLong(this->WindowId,vtkWndOffset,(vtkLONG)this);
and finally in the method Finalize in the statement
vtkSetWindowLong(this->WindowId,vtkWndOffset,(vtkLONG)0);
In class vtkWin32RenderWindowInteractor I use vtkWndOffset in its
destructor in the statement
tmp = (vtkWin32OpenGLRenderWindow *)(vtkGetWindowLong(this-
>WindowId,vtkWndOffset));
in the method Enable in the statement
tmp=(vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this-
>WindowId,vtkWndOffset);
and in the method Disable in the statement
tmp = (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this-
>WindowId,vtkWndOffset);
Finally, I use vtkWndOffset in the procudure vtkHandleMessage in the
statement
ren = (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong
(hWnd,vtkWndOffset);
Hope this answers your question.
Leo van Ruijven.
----- Original Message -----
From: David Cole <david.cole at kitware.com>
Date: Tuesday, December 19, 2006 3:48 pm
Subject: Re: [vtkusers] Issue with VTK and windows 64BIT
> Thanks for this... I'll try to to get this committed this week.
> (That code
> recently moved into header file Common/vtkWin32Header.h...)
>
> Where do you use "vtkWndOffset"? You added that, but didn't
> mention where
> you're using it...
>
> Thanks,
> David Cole
> Kitware, Inc.
>
>
> On 12/19/06, L.J. van Ruijven <L.J.vanRuijven at amc.uva.nl> wrote:
> >
> > Hi,
> >
> > I am using VTK for windows x64. In the past several problems were
> > solved thanks to Jeremy Drysdale and Andreas Gerndt (see
> > http://public.kitware.com/pipermail/vtkusers/2006-
> August/086498.html).> However, problems with the interaction still
> remained. I found that
> > several of the remaining issues are solverd with the following fix:
> >
> > In vtkWin32RenderWindowInteractor.cxx change:
> >
> > #if ( _MSC_VER >= 1300 ) // Visual studio .NET
> > #pragma warning ( disable : 4311 )
> > #pragma warning ( disable : 4312 )
> > # define vtkGWLP_HINSTANCE GWLP_HINSTANCE
> > # define vtkGetWindowLong GetWindowLongPtr
> > # define vtkSetWindowLong SetWindowLongPtr
> > #else // regular Visual studio
> > # define vtkGWLP_HINSTANCE GWL_HINSTANCE
> > # define vtkGetWindowLong GetWindowLong
> > # define vtkSetWindowLong SetWindowLong
> > #endif //
> >
> > into:
> >
> > #if ( _MSC_VER >= 1300 ) // Visual studio .NET
> > #pragma warning ( disable : 4311 )
> > #pragma warning ( disable : 4312 )
> > # define vtkGWLP_HINSTANCE GWLP_HINSTANCE
> > # define vtkLONG LONG_PTR
> > # define vtkWndOffset sizeof(vtkLONG)
> > # define vtkGetWindowLong GetWindowLongPtr
> > # define vtkSetWindowLong SetWindowLongPtr
> > #else // regular Visual studio
> > # define vtkGWLP_HINSTANCE GWL_HINSTANCE
> > # define vtkLONG LONG
> > # define vtkWndOffset sizeof(vtkLONG)
> > # define vtkGetWindowLong GetWindowLong
> > # define vtkSetWindowLong SetWindowLong
> > #endif //
> >
> > Now change all occurences of LONG into vtkLONG.
> >
> > Leo.
> >
> >
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
> >
> >
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ljvanruijven.vcf
Type: text/x-vcard
Size: 262 bytes
Desc: Card for "L.J. van Ruijven" <L.J.vanRuijven at amc.uva.nl>
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061219/30a70272/attachment.vcf>
More information about the vtkusers
mailing list