>>Hello,
>>
>>I am not sure how to instantiate objects from ActiveX.
>>
>>I am using an ActiveX control, and according to the documentation this control has several member objects.
>>
>>Instantiating the ActiveX control itself works fine by just dropping the ole control on a form.
>>
>>In VB, accessing the member objects is done like this:
>>
>>Object = "{27036179-0999-461D-B06E-B1E86B21B6E7}#1.0#0"
>>Public OMRProcessor As OMRProcessor
>>
>>But I don't know how to translate that into VFP.
>>
>>Any idea?
>
>Just guessing you may want to look at createobject and createobjectx functions.
I think createobject works only with VFP and automation enabled applications.
According to VFP help, I have to create a OLEOBJECT container class:
PUBLIC frmOLETest
frmOLETest = CREATEOBJECT('Form')
frmOLETest.Visible = .T.
frmOLETest.AddObject('OCXTest', 'BlueOLEControl', 'MSComctlLib.ListViewCtrl')
frmOLETest.OCXTest.View = 2
frmOLETest.OCXTest.ListItems.Add(1,'one','Item One')
frmOLETest.OCXTest.ListItems.Add(2,'two','Item Two')
DEFINE CLASS BlueOLEControl AS OLEControl
.Object.Backcolor = 16776960
Visible = .T.
Height = 100
Width = 200
ENDDEFINE
But that would work only with the ActiveX control itself, not with its member objects.
Christian Isberner
Software Consultant