I needed to return some data from self-written FreeBasic DLL so I written callback function and managed successfully  call it by pointer from DLL but... it works... not always - in most cases it crash claiming variable not declared while this variable is global or declared local just above, ( this crash can even take place in WM_NOTIFY function - mostly when i make callback function  volatile) , Sometimes callback function quit/return on halfway.   Is there a some tips to make reliable