Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create Object from ActiveX
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Create Object from ActiveX
Divers
Thread ID:
00183418
Message ID:
00183418
Vues:
107
I was trying to create an object from an OLEControl ActiveX class I defined. I was getting the error 'Object class is invalid for this container.'. The only way I got it to work was putting it in a Form Class and then I could access the properties, methods and events for the OLE Active control. I also tried adding the OLEControl object to other control types but got the same error when I tried to create an object. I was using the GUI for all this then decided to try it in code. The code below illustrates what I was trying to do. Note when I define the class thecal as any other than a form type I get the error. What am I doing wrong? Thanks in advance.

okcal=createobject("thecal")
okcal.show()

DEFINE CLASS thecal as FORM (*NOTE: FORM ONLY WORKS*)
windowtype = 1

ADD OBJECT ocal AS ocal WITH ;
Top = 0, ;
Left = -4, ;
Height = 180, ;
Width = 269, ;
Name = "Ocal"

ENDDEFINE



DEFINE CLASS ocal AS olecontrol
Height = 182
Width = 314
Name = "ocal"
oleclass="MSACAL.MSACALCtrl.7"
oletypeallowed = 1
ENDDEFINE
Michael Garcia
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform