>*** ActiveX Control Event *** >LPARAMETERS keyascii > >if keyascii = 27 > thisform.cmdexitg1.Click() > nodefault >* thisform.KeyPress(keyascii) && tried this too, but ii does nothing... >else > dodefault() >endif >>It works, it presses the Exit button, the form exits, and then I get C0000005. Any ideas what's wrong?
PUBLIC oform1 oform1=NEWOBJECT("form1xxx") oform1.Show RETURN DEFINE CLASS form1xxx AS form Caption = "Form1" Name = "Form1" ADD OBJECT olecontrol1 AS olecontrol WITH ; Top = 36, ; Left = 48, ; Height = 169, ; Width = 205, ; Name = "Olecontrol1",; oleclass = 'MSComctlLib.TreeCtrl.2' ADD OBJECT cmdExit AS commandbutton WITH ; Top = 215, ; Left = 48, ; Cancel = .t., ; Height = 25, ; Width = 50, ; Name = "cmdExit", ; caption = 'Close' PROCEDURE olecontrol1.init WITH this.object .Nodes.Add(,,,'One') .Nodes.Add(,,,'Two') .Nodes.Add(,,,'Three') ENDWITH ENDPROC PROCEDURE olecontrol1.keypress LPARAMETERS keyascii if keyascii = 27 thisform.cmdexit.Click() nodefault * thisform.KeyPress(keyascii) && tried this too, but ii does nothing... else dodefault() endif ENDPROC PROCEDURE cmdExit.Click thisform.Release ENDPROC ENDDEFINEThanks!