This is an odd error, but when I have an event hook like that below, it crashes with an Unhandled Memory Exception Error if a function gotten from a function pointer is called.
Function MainWindowHook:Object(id:Int,data:Object,context:Object)
Local event:TEvent=TEvent(data)
If event=Null Return data
Select event.id
Case EVENT_WINDOWSIZE
GetVersion()
Return Null
EndSelect
Return data
EndFunction
GetVersion() is a global function, loaded from a dll, like this. I used this one for testing, because it is a simple benign function.
Global GetVersion:Int() "win32"
GetVersion=getprocaddress(HLIB_ENGINE,"GetVersion")
This only happens if a function is called in the dll which creates a MaxGUI window. For instance, my Graphics() function in the dll creates a window with an OpenGL viewport drawn on it.
Any ideas?
|