Making the callback __stdcall fixed the problem. No clear way how to do a grab without using a callback, so remove that code. Also use unpack function provided by the library rather than rolling our own.
Making the callback __stdcall fixed the problem. No clear way how to do a grab without using a callback, so remove that code. Also use unpack function provided by the library rather than rolling our own.