How to pass a function pointer to a DLL ?
BlitzMax Forums/BlitzMax Programming/How to pass a function pointer to a DLL ?
| ||
Hi all, In the winmm.dll there is this function: Function MidiInOpen(lphMidiIn:Byte Ptr, uDeviceID:Byte Ptr, dwCallback:Byte Ptr, dwInstance:Byte Ptr, dwFlags:Int) Which I declare with an Extern...End Extern from within BMAX. So, for the parameter dwCallback I have to pass a function pointer. The question: how can I pass a BMAX function pointer to that DLL function ? A working example would be really appreciated. Regards, Sergio. |
| ||
Not a working example with winmm but it shows that conversion between a function pointer and a byte ptr is easy enough to do.Local fpointer:Byte Ptr fpointer = test Local p() = fpointer p() End Function test() Print "test" End Function |