Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Define A form based Class with DataEnvironment
Message
 
 
To
11/05/2001 11:05:19
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00506128
Message ID:
00506232
Views:
16
>Hi, George and Larry
> Thanks your reply. In my case, I need a new type of form class, which need to redefine the dataenvironment properties such as autoopen/closetables and some other methods to add some functions of checking user rights at data loading section. But after serval tries, I have to give it up. Now I've written a program to modify every scx files to change the dataenvironment properties and methods into the way I wanna it to be. Maybe it's a stupid solution, anyway it works and seems very easy. But I still wanna know if there is a good solution.:)

Robin,
You can define a DataEnvironment class in a program (it is not a visually editable class). You can add any new methods you want and provide the necessary hooks to call them automatically during the normal instantiation sequence or call them manually.

In the Load event of the form class, simply AddObject/NewObject it to your class. You can have a method that adds cursor objects and calls the OpenTables method.

Some of the OO frameworks (e.g. VFE) use this technique.

HTH.
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