General information
Category:
ActiveX controls in VFP
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only