>How do I do to add an ActiveX control to _screen with the AddObject()?
>
I've never done this, but from the error returned by trying the obvious approach:
_screen.AddObject('oComm1','MSCOMMLIB.MSCOMM') && tries to add the MSComm control
I'd guess that if it can be done at all, you'd have to create a subclass using the OLEControl class; I couldn't get this to work, either, although I can add the class below trivially to a class instance derive from the Form class:
DEFINE CLASS MSComm AS OLEControl
OLETypeAllowed = -2
OLECLASS = 'MSCOMMLIB.MSCOMM'
ENDDEFINE
oForm = CREATEOBJ('Form')
oForm.AddObject('oComm','MSComm')
If you need to attach an ActiveX control to the main VFP Window for the application, in all probability you'll have to use a top-level window instead of _SCREEN, and then have all forms' ShowWindow set to 1 if they need to be treated as a child of the active top-level form rather than the default of 0. You can do an AddObject of a subclass of OLEControl to a top-level form, either visually using the Form Designer or programmatically.
If the ActiveX control didn't need to have a screen presense, like SysInfo or MSComm, you could use the VFP6 AddProperty method to add it to _screen, creating the instance of the control via CREATEOBJ() or NEWOBJECT():
_Screen.AddProperty('oComm')
_Screen.oComm = CREATEOBJ('MSCOMMLIB.MSCOMM')
You could then use a wrapper class and VFPCOM to tie VFP Code to the events using VFPCOM's BindEvents method.