First of all: What is a callback function?<br><br>My problem is, i´m trying to write my class to manage a Joystick, in this class I define two member functions:<br><br>BOOL CALLBACK EnumJoy(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef);<br><br>BOOL DI_Init();<br><br>DI_Init() calls EnumDevices wich is defined as follows:<br><br>HRESULT EnumDevices(<br> DWORD dwDevType, <br> LPDIENUMCALLBACK lpCallback, <br> LPVOID pvRef, <br> DWORD dwFlags <br>);<br><br>The second parameter (lpCallback) is the <br>Address of a callback function to be called with a description of each DirectInput device.<br><br><br>My Call is implemented as follows:<br><br>if( !m_lpDIJoystick )<br> hr = m_lpDI->EnumDevices( DIDEVTYPE_JOYSTICK, EnumJoy, (LPVOID)FALSE,DIEDFL_ATTACHEDONLY) ;<br><br><br>When I try to compile it I get the following error message:<br><br> error C2664: 'EnumDevices' : cannot convert parameter 2 'int (const struct DIDEVICEINSTANCEA *,void *)' in 'int (__stdcall *)(const struct DIDEVICEINSTANCEA *,void *)' <br><br>If I define my member function EnumJoy out of my class as a global function than I compile my program but I would like to have it as a member function, how should I declare it?. <br>Thanks in Advance.<br><br>javi<br>