ofAppGlutWindow::winProc() not called when compiled as x64

Hello,

I’m receiving multi-touch signals from the native windows multi-touch system, as described in this topic:
http://forum.openframeworks.cc/t/windows-7-and-multitouch-with-openframeworks/3120/0

Because I need to use a lot of memory, I’ve compiled the openframeworks libraries as 64bit. This works great, however the ofAppGlutWindow::winProc() function is not being called anymore.

I read in this topic a little about how it works, but I can’t figure out what the problem is.
http://forum.openframeworks.cc/t/stopping-application-on-window-close-with-of-window/22/0

Perhaps the problem is that I recompiled glut? Any ideas how to get this to work again?

I’ve tried freeglut as well. This does actually close the entire program and not just the window, but there are no messages coming in to the ofAppGlutWindow::winProc() function.

This is used for both WM_TOUCH as well as WM_DROPFILES, so I’d really like to get this to work again.

Any ideas would be greatly appreciated.

Kind regards,
Harry Vermeulen

Found the solution here:
http://stackoverflow.com/questions/5138156/access-violation-exception-in-64bit-mfc-version

Modified this function:

  
  
static void fixCloseWindowOnWin32(){  
  
	//get the HWND  
	handle = WindowFromDC(wglGetCurrentDC());  
  
	// enable drag and drop of files.  
	DragAcceptFiles (handle, TRUE);  
  
	//store the current message event handler for the window  
	currentWndProc = (WNDPROC)GetWindowLongPtr(handle, GWLP_WNDPROC);  
  
	//tell the window to now use our event handler!  
	SetWindowLongPtr(handle, GWLP_WNDPROC, (long)winProc);  
  
}  
  

To be:

  
  
static void fixCloseWindowOnWin64() {  
  
	//get the HWND  
	handle = WindowFromDC(wglGetCurrentDC());  
  
	// enable drag and drop of files.  
	DragAcceptFiles (handle, TRUE);  
  
	//store the current message event handler for the window  
	currentWndProc = (WNDPROC)GetWindowLongPtr(handle, GWLP_WNDPROC);  
  
	//tell the window to now use our event handler!  
	SetWindowLongPtr(handle, GWLP_WNDPROC, (LONG_PTR)winProc);  
  
}  
  

(note the cast to LONG_PTR instead of long, which was causing trouble.)

Uploaded my (Windows) 64bit version of openFrameWorks, in case anyone wants a quick start:
http://harryvermeulen.wordpress.com/2012/02/03/64bit-openframeworks-windows-x64/

Only has a project for Visual Studio, but the libraries might be usable in code::blocks as well (haven’t tested).