Q: I have a unit that does a callback function (from a DLL). In this unit, I have declared a global variable. When I do the callback, it is unable to 'see' the global variable. Both functions are in the same unit. Why is this and what do I do?
A: Turn off smart callbacks and add this:
{$K-}
Because of how things are being passed to the CPU (register manipulation)
the scope has changed through a callback.