adding to the knowledge (??)
one of my peeps (very bright young lady) stayed up late last night playing with the problem.. she REALLY WANTS TO USE BLITZ... or she needs to get a life...here is what she found:
using XP .. VB2008 .net .....Kanti's 2nd Example..using PicBox as canvas...Problems encountered with VB2008.net are as Monotonic and others stated above..
KeyHit in example always returns zero.. NO KEY or Mouse strokes are recognized by windows or Blitz.. i.e., app appears dead..
what she Did:
kanati's Code: b3d.PositionEntity(camera, 0, 0, -4, 1)
'while the escape key isn't hit, rotate the cube and update the world...
While b3d.KeyHit(KEY_ESCAPE) = 0
b3d.UpdateWorld(1)
...etc...
b3d.Flip(1)
End While
b3d.EndBlitz3D()
replaced with:
me.keypreview()
while KeepGoing
System.Windows.Forms.Application.DoEvents() ' let Vb events fire
b3d.updateworld.... etc
end while
b3d=nothing
assuming winform is FORM1
in the form1.KeyPress event
If AscW(e.KeyChar) = System.Windows.Forms.Keys.Escape Then
KeepGoing = False
End If
...
apparently here is what is happening...
the KeyPreview allows the FORMS KeyPressed event
to GET the keypressed BEFORE it is passed to Whatever other control has focus (i.e. Textbox)... testing here for escape and setting var to terminate the Blitz loop works...
after falling out of the loop Kanati's code had the ENDBLITZ3D statement.. if left here VB2008 aborts with
ATTEMPT TO ACCESS CORRUPT MEMORY error.. interesting in that it aborts in the KEYHIT code of the SDK ...Hmm...setting the created class to nothing and using the App closing to clean up seems to work...
Note: Setfocus (Focus) does not work in vb2008.net. i.e making sure focus is on a control (i.e. TextBox) and using that controls keypressed event DOES NOT WORK ...also insuring focus is on the target control DOES NOT WORK .... but this keypreview does... why ??? ... Not a clue.....
one of my peeps (very bright young lady) stayed up late last night playing with the problem.. she REALLY WANTS TO USE BLITZ... or she needs to get a life...here is what she found:
using XP .. VB2008 .net .....Kanti's 2nd Example..using PicBox as canvas...Problems encountered with VB2008.net are as Monotonic and others stated above..
KeyHit in example always returns zero.. NO KEY or Mouse strokes are recognized by windows or Blitz.. i.e., app appears dead..
what she Did:
kanati's Code: b3d.PositionEntity(camera, 0, 0, -4, 1)
'while the escape key isn't hit, rotate the cube and update the world...
While b3d.KeyHit(KEY_ESCAPE) = 0
b3d.UpdateWorld(1)
...etc...
b3d.Flip(1)
End While
b3d.EndBlitz3D()
replaced with:
me.keypreview()
while KeepGoing
System.Windows.Forms.Application.DoEvents() ' let Vb events fire
b3d.updateworld.... etc
end while
b3d=nothing
assuming winform is FORM1
in the form1.KeyPress event
If AscW(e.KeyChar) = System.Windows.Forms.Keys.Escape Then
KeepGoing = False
End If
...
apparently here is what is happening...
the KeyPreview allows the FORMS KeyPressed event
to GET the keypressed BEFORE it is passed to Whatever other control has focus (i.e. Textbox)... testing here for escape and setting var to terminate the Blitz loop works...
after falling out of the loop Kanati's code had the ENDBLITZ3D statement.. if left here VB2008 aborts with
ATTEMPT TO ACCESS CORRUPT MEMORY error.. interesting in that it aborts in the KEYHIT code of the SDK ...Hmm...setting the created class to nothing and using the App closing to clean up seems to work...
Note: Setfocus (Focus) does not work in vb2008.net. i.e making sure focus is on a control (i.e. TextBox) and using that controls keypressed event DOES NOT WORK ...also insuring focus is on the target control DOES NOT WORK .... but this keypreview does... why ??? ... Not a clue.....