Hi!
Following could only work at all:
object.ADDOBJECT("myproperty", "myoleclass")
This is because CreateObject could not create ActiveX objects.
Also, check follwoing conditions:
- You're adding ActiveX ito the form (object is a VFP form object)
- "myoleclass" is available, in other words, you used SET CLASSLIB ... ADDITIVE command to load class library with that class.
HTH.
>hi,
>I have a custom class named "myoleclass" that contain a ActiveX control.
>I face problem of CREATEOBJECT() during runtime.
>I tried the following code but it return "Object class is invalid for this container"
>
>
>myvar = CREATEOBJECT("myoleclass")
>Or
>object.myproperty = CREATEOBJECT("myoleclass")
>Or
>object.ADDOBJECT("myproperty", "myoleclass")
>
>It work in VFP7 but not in VFP6
>
>Any workaround?
>How to acess this object without adding it to form?
>
>Thank you
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.