* NOTE - code by command line entry. * * Create PRG file with class code that contains method onComm. x = createobject("VFPCOM.COMUtil") y = createobject("Mscommlib.Mscomm.1") x.exportevents(y, "c:\myComm.prg") x = .null. y = .null. ********************************** * myComm.prg would contain something like... * * DEFINE CLASS DMSCommEvents AS custom * * PROCEDURE OnComm * * Add user code here * ENDPROC * * *ENDDEFINE * ********************************** * * Then in your code, create the object from the myComm.prg file... * x = createobject("VFPCOM.COMUtil") y = createobject("Mscommlib.Mscomm.1") myComm = createobject("DMSCommEvents") x.BindEvents(y, myComm) * Now when oncomm your onComm will handle the event correctly. x.UnBindEvents(y, myComm) x = .null. y = .null. myComm = .null. * Hope this helps.