MinGW64 build on Windows7 error in vtkWin32VideoSource::Initialize() call to vtkSetWindowLong (not Ptr)
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Initial problem reported below - complained about the cast. I tried removing these casts, so passing 'this' as native size which reveals WINUSERAPI LONG WINAPI SetWindowLongA(HWND hWnd,int nIndex,LONG dwNewLong) is called. MSDN suggests SetWindowLongPtr() for 64-bit apps.
== build system output == [ 93%] Building CXX object IO/Video/CMakeFiles/vtkIOVideo.dir/vtkWin32VideoSource.cxx.obj /IO/Video/vtkWin32VideoSource.cxx: In function 'LONG vtkWin32VideoSourceWinProc(HWND, UINT, WPARAM, LPARAM)': /IO/Video/vtkWin32VideoSource.cxx:105:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (vtkGetWindowLong(hwnd,vtkGWL_USERDATA)); ^ /IO/Video/vtkWin32VideoSource.cxx: In member function 'virtual void vtkWin32VideoSource::Initialize()': /IO/Video/vtkWin32VideoSource.cxx:277:71: error: cast from 'vtkWin32VideoSource*' to 'LONG {aka long int}' loses precision [-fpermissive] vtkSetWindowLong(this->Internal->ParentWnd,vtkGWL_USERDATA,(vtkLONG)this); ^ In file included from /IO/Video/vtkWin32VideoSource.cxx:31:0: /IO/Video/vtkWin32VideoSource.cxx:342:52: error: cast from 'vtkWin32VideoSource*' to 'long int' loses precision [-fpermissive] if (!capSetUserData(this->Internal->CapWnd,(long)this)) ^ IO/Video/CMakeFiles/vtkIOVideo.dir/build.make:82: recipe for target `IO/Video/CMakeFiles/vtkIOVideo.dir/vtkWin32VideoSource.cxx.obj' failed