Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create Object from ActiveX
Message
From
04/02/1999 00:11:50
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00183418
Message ID:
00183778
Views:
15
Did you try Container instead of Form?

Vlad

>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform