Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing a control
Message
From
05/04/1998 12:52:07
 
 
To
04/04/1998 17:09:44
Jay Shepherd
Construction DataFax, Inc.
Montevallo, Alabama, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00089576
Message ID:
00089624
Views:
26
Is MyControl an ActiveX or a VFP class?

In VFP there are 2 ways to instantiate an ActiveX object. Either you wrap the ActiveX into an OleControl and add an object of this new class to a form, or you use the CreateObject to create the object directly from the ActiveX (it can be used alos to instantiate the new OleControl class defined as in the first method.)

I assume that MyControl is an ActiveX:
In your code, if you declare the CDNS of type OleControl, than you should have inside the class definition a

OleClass = "MyControlProgID"

If you declare CDNS as custom, than you can't add directly an ActiveX to the class using ADD OBJECT.

If MyControl is an ActiveX

Now, if what you want to do is to subclass an ActiveX and to inherit all its properties and methods, you should define the class like this:

DEFINE CLASS CDNS AS OleControl
CLASS = "MyControlProgID"
ENDDEFINE

But you will be able to use this class only with Form.AddObject() to instantiate an object of this class...

Please note that "MyControlProgID" is not the exact string thar should be used. The real value is the one found in the registry under ProgID for the ActiveX control.

Vlad

>>DEFINE CLASS CDNS AS OleControl
>> add object oTest as "MyControl"
>>ENDDEFINE
>
>Sorry, that code was pasted from the wrong thing... this is the DEFINE line that I'm using.
>
>DEFINE CLASS CDNS AS Custom
Previous
Reply
Map
View

Click here to load this message in the networking platform