Some words about the class SessionDE from library LibSE.vcx (for VFP 6.0 SP3 and later)

Problem:
   Definitions of classes DataEnvironment are located into prg-file. However, it reduce to problem of use of such DE-classes in the forms, and that is why:
   The main thing of problem that a method MyForm.AddObject () does not allow to create instances of classes from prg-files immediately (only from vcx-libraries together with SET CLASSLIB TO...), while only just the method AddObject () correctly works with Private Data Session of the form, as against CreateObject()/NewObject() [see subj "I have VFP 6.0+SP3 VS6 and now has appeared class Session. Whether will show an example of its use?" in FAQ on http://vfpdmur.narod.ru/ask_e.html]
   The possible way to overcome the difficulties consists in locating a class SessionDE in vcx-library. However again, to make it immediately it is not possible. Nevertheless, there is a small trick to realize it. Pitches below are explained how do it, on an example a class SessionDE of library LibSE.vcx

Solution:
1) Create a new class Custom
2) Edit it in Class Designer, implying, that it is a class Session
3) On completion of editing open vcx-library as the dbf-file and change fields values Class and BaseClass from custom to session
4) Recompile the project, with the flag Recompile All Files 
5) If you will need to edit thus obtained class directly "as is" to make it immediately in Class Designer it is not possible. However, by inverse action in item 3) higher, you receive a class edited from Class Designer. After modification it is necessary only to execute items 3-4 above.

Warning:
If you accidentally have tried to edit a not edited class Session i.e. have received Error 1978, it is better to close VFP environment and to open it again, as such attempt of editing results to exclusive-grab of the file of your library and any forces to be closed of such grab is not possible :-( The reliable indication of a possibility of editing of a class SessionDE in Class Designer is the availability is the icon of a class Custom on a tab Classes in the project. And on the contrary, do not try to open on editing in Class Designer a class, which does not have icon (i.e. derivative from Session), it inevitably will reduce Error 1978.  

Using:
To check up said above you can on the following example containing files:
Libs\LibSE.vcx - is created on a just technique above.
Progs\ExampDE.prg - code, created by the GenDE utility for the form Forms\frmGenDE.scx
Progs\ExampWithLibSE.prg - two examples using of the class SessionDE from library LibSE.vcx... and second (for the form) just shows correct use of a class Session in a case Private Data Session in the form

Code of methods for class SessionDE from library LibSE.vcx I have located in the Progs\MethodsSE.prg file.

Michael Drozdov, ICS Soft, Perm, Russia
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mailto:Drozdov@ics.perm.su
My Page:  http://vfpdmur.narod.ru/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~