Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing an OCX
Message
From
21/01/2000 13:57:10
 
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00319745
Message ID:
00321041
Views:
25
>>>Does that mean if you have this sub-classed ActiveX control in a VCX library, that you can now use it in code, too? How would you use it in a DEFINE CLASS myform AS FORM, for example. I've had trouble trying to do this from a .PRG.
>>>
>>>TIA
>>
>>You can use it from code, but it still has to be added to a valid container- you can't instantiate it with CREATEOBJECT, you have to use AddObject. If you are building a form class in code you would add this control using ADD OBJECT.
>
>Thanks, Erik and Markus. I was trying to do it with CREATEOBJECT to an existing property. Never occured to me to try to create it as a new object. Duh!

Yeah, there is a very important difference between assigning an object to an existing property with CREATEOBJECT, and adding the Object Using o.AddObject or o.NewObject- the former does not add the object to the container, it merely gives the container a reference to the new object. Contained objects will be cleaned up when the container is destroyed, referenced objects will cause the container to hang because of an outstanding reference. And, as you found, there are certain controls that must live in the container, and not just be referenced by it.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform