Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I release a class
Message
 
À
17/06/1997 14:46:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00036657
Message ID:
00036813
Vues:
34
>I first wonder why you are trying this particular sequence...
>
>Beyond that, "SET CLASSLIB TO MyClass IN MyApp" opens MyApp, locates the library MyClass if it is in there, and notes to the system that MyClass is to be searched first for any class references (such as in CreateObject()). This implies that the file MyApp.app remains open.
>
>"SET CLASSLIB TO" then instructs VFP not to search any particular path for class references. *This does not close MyApp.app*
>
>The attempt to recompile tries to overwrite a currently open file, and your error results.
>
>These commands affect class libraries - your problem is with an open .app file.
>
>In order to helpfully answer your question, I need to return to my opening question - what is the effect you are trying to create here? "CLOSE ALL" might work, but it's a sledgehammer approach.

It makes sense that Myapp.app is still, but how do I close it? CLOSE ALL does not work. Only exiting FoxPro and starting it back up does the trick.

As far as what I am trying to do, this might take a while to explain. I have a project that includes six visual classes (VCX) into my project. In VFP 3.0, I would SET PATH to the directories where these VCX's reside. In my application, I would SET CLASSLIB TO myclass.vcx ADDITVE, and all worked fine. Of couse once the application has been compiled to an EXE and moved out to the network, the actual directories for which the VCX's reside no longer exist.

In my DBC, I have use the CREATEOBJECT() to instatiate an object needed to generate a primary key. In VFP 3.0, I have no problem with this. In VFP 5.0, it cannot find the class to instiate the object. It give me the following error with "Locate class" in the window title when the CREATEOBJECT() is encountered:

"Error instatiating class. Cannot find myclass.vcx."

Buttons on the window include Locate..., Ignore, Cancel, and Help. No matter what the user does the program gets caught up in a loop. The funny thing is that typing FILE("myapp.vcx") in the Watch Window at the point of error give me True. I cannot remember, but it seemed that doing a SET CLASSLIB myclass IN myapp got around this error.

This leads me to the error that I discussed earlier where myapp is still open. It seems to me that the RELEASE CLASSLIB myclass IN myapp is the answer, but this command does work. I think it is a bug in FoxPro or a Doc error. What do you think? Can you think of any workarounds? Of course, the user is not affected by the "myapp still open" error, but it makes development work a real pain.

I hope this is enough detail for you. Thanks everyone for your help!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform