[vtkusers] vtknightly : win32 interactor not working

Ken Martin ken.martin at kitware.com
Wed Aug 2 14:27:06 EDT 2000


You must change your MFC window a little.  Specifically if you have code 
like the following (taken from vtkMFCRenderView.cpp) then make sure you are 
calling vtkHandleMessage2 as shown below instead of the old approach of 
call vtkHandleMessage

- Ken


// Define our own event handler here
LRESULT vtkMFCRenderView::WindowProc(UINT message, WPARAM wParam, LPARAM 
lParam)
{
   switch (message)
     {
     //case WM_PAINT:
     case WM_LBUTTONDOWN:
     case WM_LBUTTONUP:
     case WM_MBUTTONDOWN:
     case WM_MBUTTONUP:
     case WM_RBUTTONDOWN:
     case WM_RBUTTONUP:
     case WM_MOUSEMOVE:
     case WM_CHAR:
     case WM_TIMER:
       if (this->Interactor->GetInitialized())
         {
         return vtkHandleMessage2(this->m_hWnd, message, wParam, lParam,
                                  this->Interactor);
         }
       break;
     }
   return vtkMFCView::WindowProc(message, wParam, lParam);
}



>I use vtk inside an MFC window. Since I downloaded the nightly on 19-7-2000,
>interaction does not work anymore. It did work with the nightly I got on
>12-7-2000.
>
>I briefly looked at the vtk source code and see a change in
>vtkWin32RenderWindowInteractor.cxx
>
>in function
>
>// This is only called when InstallMessageProc is true
>LRESULT CALLBACK vtkHandleMessage(HWND hWnd,UINT uMsg, WPARAM wParam,
>                                   LPARAM lParam)
>
>This line was changed from :
>
>       ren = (vtkWin32OpenGLRenderWindow *)GetWindowLong hWnd,GWL_USERDATA);
>
>
>To
>
>   ren = (vtkWin32OpenGLRenderWindow *)GetWindowLong(hWnd,4);
>
>(and the call to this function returns NULL)
>
>Looking at visual c++, I see that GWL_USERDATA is defined as -21.
>
>Is something wrong with vtk or with how I use it ?
>
>Joris
>--
>
>================
>Joris Vanden Wyngaerd
>coordinates : http://www.esat.kuleuven.ac.be/~joris/personalia.html
>
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list