SetBlitz3DEventCallback and SetBlitz3DHWND Bug

Blitz3D SDK Forums/Blitz3D SDK Bug Reports/SetBlitz3DEventCallback and SetBlitz3DHWND Bug

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ok... attempting the same thing monotonic did but in vb.net...

Added this to the form...
    Dim del As New DelegateBlitzEvents(AddressOf BlitzEvents)

    Private Delegate Function DelegateBlitzEvents(ByVal hwnd As Integer, ByVal msg As Integer, ByVal wparam As Integer, ByVal lparam As Integer) As Integer

    Private Function BlitzEvents(ByVal hwnd As Integer, ByVal msg As Integer, ByVal wparam As Integer, ByVal lparam As Integer) As Integer
        Select Case msg
            Case &H101
                MsgBox("KEY HIT!!")
        End Select
    End Function


Added this to the setup before calling beginblitz3d
        del = AddressOf BlitzEvents
        b3d.SetBlitz3DEventCallback(Marshal.GetFunctionPointerForDelegate(del))


Added this to the vb wrapper
    <DllImport("user32.dll")> _
    Public Shared Function SetFocus(ByVal hWnd As Integer) As Integer
    End Function


Added this to the loop
            SetFocus(PictureBox1.Handle.ToInt32)


The callback doesn't appear to be getting called. I'm not sure if it has to do with the way I'm setting up the delegate (first time messing with delegates and unmanaged code) or with the setfocus call. ARGH!

Why can't anything at all be simple like the old days? :)