Ok... attempting the same thing monotonic did but in vb.net...
Added this to the form...
Added this to the setup before calling beginblitz3d
Added this to the vb wrapper
Added this to the loop
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? :)
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? :)