Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying An OleClass
Message
From
03/01/2017 16:03:09
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
03/01/2017 14:58:44
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01646275
Message ID:
01646281
Views:
56
>So I have a class, vsflex_cursor of vsflex_lite.vcx that I want to copy. It is an OleClass.
>
>I want to copy (not subclass) it, with the usual way being:
>
>
>create classlib dummy
>add class vsflex_cursor of vsflex_lite to dummy
>
>
>What I get is "Object class is invalid for this container."
>
>This happens with all of OLE controls in the project.
>
>Is this known behavior? A Google search brought up irrelevant hits based on the error message (other issues).

I had this message for a different reason. Had a pageframe class with pagecount=0 and then when pages were added at design time, at runtime the .activepage would still be zero, even though it was set to 1 in the pem sheet of the subclassed instance (of the container on which this pgf resides). I guess it was the sideeffect of having memberclass="mypage" set, which tends to run a few things from the parent class before applying things from the child class or instance (so pages' .init() of the pages class runs before even form.load() etc... and other side effects).

The only way to surely have the .activepage=1 was to set the parent pgf's pagecount=1. But then it wanted to have this first page named Mypage1 - and in the classes already created while it had zero pages, it was named differently. I was getting that same error when I tried to add such a class to a different vcx, or when I tried to edit it. I eventually had to hack the classlib and go through the names of the pages in parent record's properties, and all the parent names in all child records, and then I was able to start using it.

Not saying that this is your case, just to note that you may get this message for a number of different reasons which all mean "I don't know how to connect this object with its container".

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform