From: awertyui@... Date: 2005-06-07T05:01:46+09:00 Subject: Ruby DL callback function for a windowProc I am trying to create a window class with ruby dl so I can create my own window but I'm stuck on the wndproc. here is what I have so far but it doesn't work. I can get it to work if I use one of the standard window classes like Button but if I do that then I dont have control over the wndproc which seems to be getting the messages I am trying to recieve. There is more to the code I just cut out the parts with the problem. module Win32 extend DL::Importable dlload 'user32.dll' , 'kernel32.dll' WNDCLASSEX = struct [ "UINT cbSize", "UINT style", "void* lpfnWndProc", "int cbClsExtra", "int cbWndExtra", "UINT hInstance1", "UINT hIcon", "UINT hCursor", "UINT hbrBackground", "LPCSTR lpszMenuName", "LPCSTR lpszClassName", "UINT hIconSm" ] def my_proc(hwnd,uMsg,wParam,lParam) puts "TEST" end MY_PROC = callback 'UINT my_proc(HWND,UINT,WPARAM,LPARAM)' end #this is the line that the program stops on. wndclass.lpfnWndProc = Win32::MY_PROC this is the error type mismatch (eval):16:in `[]='