Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ActiveX Objects
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01286285
Message ID:
01286290
Vues:
54
>>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
   * Set property for Outline ActiveX control.
   .Object.Backcolor = 16776960
   
   * Set properties for the OLE Container control.
   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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform