Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Do I overide the class code
Message
 
 
To
09/01/2001 19:10:50
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00460393
Message ID:
00461472
Views:
14
In that case, I would create a form composite class that had an instance of the COMM control with the appropriate code. Then you could create as many "scale" objects as you had scales.

>The reason I use Addobject is because I need the server to be able to service n scales. So that by setting up some properties I can have 3 instances or 4 or 5 of the timer object quering 3 different COM ports for input. I use this for reading weights off a scale connected to a COM port.
>
>I wanted to make the Server generic so that it wil work with any number( within reason) of scales. Hence the Addobject, adding scale objects at setuptime.
>
>Bernard
>
>>Bernard,
>>Do you have to use Addobject? I may be stating something obvious but why can't you drop an instance of the container on the form and add instance specific code there? Unless the container does an Addobject of a special timer class, the timer object should be available in the form designer. Add your code to the Timer event and then call DODEFAULT() to execute the parent code, if desired.
>>
>>HTH.
>>
>>>I have a container class that contains other objects including a timer. The class code in the timer.timer method runs every n seconds as set. This code gets a value which is then stored in a property of the class.
>>>
>>>To use this class called "olescale" I have in a form.init
>>>
>>>SET CLASSLIB TO myclass.vcx
>>>ThisForm.ADDOBJECT("myclass","olescale")
>>>
>>>Various class properties are set and then the timer is enabled.
>>>
>>>What I need is a way to add my own code to the Timer.Timer code of the class after it is ADDed the same way I can change its properties, so that it will look and run as follows:
>>>
>>>* oleclass.Timer1.Timer()
>>>
>>>My code here
>>>...
>>>...
>>>
>>>
>>>DODEFAULT() && run the class code
>>>
>>>Some More of my code here
>>>...
>>>...
>>>
>>>
>>>I can instanstiate the object with ADDOBJECT but how do I get my code to be run in a method of this class?
>>>
>>>I do not want to place the code into the class itself, as this class can be used for other things.
>>>
>>>Is this possible?
>>>
>>>Thanks
>>>
>>>BErnard
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform