Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Non-visual Class
Message
From
20/05/2002 18:53:40
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00659044
Message ID:
00659163
Views:
34
>I sure appreciated you taking the time to review my code/thoughts.

No problem.

>Just to make sure we are on the same page, you are saying you use code like the following for the non-visual .prg class, corret?

Yup. Obviously, you can add any of the other event methods like Init, Error, Destroy etc.,

>Can you expand on this just a little - what you mean by more flexibility (it does look like the code is easier to maintain like this).

Well, in VFP7, there are several new features that have been aimed at developing and maintaining prog based classes for use as COM components, especially when using the SESSION base class as opposed to CUSTOM. These features just lend to "ease of use" when handling prog based classes. The code is most definately easier to read/maintain. You can see the structure and layout of the class far better than you can in a VCX. Also, you can create other class(es) in the same .PRG that may have relevance to the main class and they are there/accessible in the same program based file.

As far as accessing these classes, you simply create your prog based libraries and add them to the Codemine project. Codemine treats the libraries as procedure files and just like VCX's, it will dynamically load them on startup using a SET PROCEDURE TO ... ADDITIVE. So, once the program is added to the project, you can forget about it and just instantiate any class you like without thought as to whether the library has been loaded.

Just back to an earlier point, I rarely, if ever use NewObject in the context of a Codemine based application because it just isn't necessary. Also, if you have utility classes that you want available all the time, you can establish your own classes as Codemine "Global Service Objects" that efficiently manage global access to these objects (take a look in the guide for more details on GSO's).

HTH
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform