Crashes if

Blitz3D SDK Forums/Blitz3D SDK Programming/Crashes if

Using this sample code from the help.

Import blitz3d.blitz3dsdk

Strict

Function BBEventHandler(hwnd,msg,wp,lp) "win32"
	bbSystemEmitOSEvent hwnd,msg,wp,lp,Null
	Return -1
End Function

bbSetBlitz3DEventCallback(BBEventHandler)

bbBeginBlitz3D()

bbGraphics3D 800,600,0,2

Local cube=bbCreateCube()
Local light=bbCreateLight()
Local camera=bbCreateCamera()

bbPositionEntity camera,0,0,-4

EnablePolledinput

While Not KeyDown(KEY_ESCAPE)
	bbTurnEntity cube,1,2,3
	bbRenderWorld
	bbText 20,20,"mouse:"+MouseX()+","+MouseY()
	bbFlip 
Wend


First it does not compile, since the bbSetBlitz3DEventCallback prototype does not match the .h header. If stick the prototype into a byte ptr and then cast it to in it crashes.

I am trying to work it out in my Delphi code as to how this hook actually works. ie. Am i responsible for handling all the messages. or if I return zero the dll will handle them?

Thanks
Doug