Hi Joe,
Because you dont want to have a form, using the OleControl isn't an option because it
has to exist within a form. In this context, I would recommend you take a look at VFPCOM.DLL. If all you need is to add code to a method of the control, VFPCOM will allow you a viable solution via its BindEvents method.
You can get the DLL from here:
Personally, I don't use VFPCOM because it takes 3 objects in memory just to manage the ActiveX object: the ActiveX object(instantiated as a COM object), the VFPCOM object that binds the objects, & the sink object that houses your method code.
This is my preferential way to do it.
If you feel you need to use the OleControl or you dont want to manage VFPCOM, try this(example with MSComm ActiveX control):
DEFINE CLASS myform AS Form
ADDOBJECT oMsComm As MsComm
PROCEDURE oMsComm.OnComm() && this can go here
***Your method code here
ENDPROC
ENDDEFINE
DEFINE CLASS MsComm As OleControl
OLECLASS='MsCommLib.MsComm'
PROCEDURE OnComm() && or it can go here
***Your method code here
ENDPROC
ENDDEFINE
Jon Hawkins
jonscott8@yahoo.com
The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed