Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ExecScript Problem
Message
From
24/03/2004 10:49:06
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00889264
Message ID:
00889275
Views:
15
Howdy Jon

>Here's the deal: On the start of our application I am issuing a bunch of SET CLASSLIB ADDITIVE statements to pull in the libraries. This works like a charm for the application as a whole.
>
>When I try to run EXECSCRIPT on a string that contains object creation code (either with CREATEOBJECT or NEWOBJECT), I get an error back stating that the app cannot instantiate the class or locate the class library in question. If I do an additional SET CLASSLIB for the library in the beginning of the string, I get an error that the alias is already in use.
>
>How am I able to have the code inside the EXECSCRIPT make use of the classes that should already be available?
>

The execscript runs completely outside of the EXE.

Use a routine that you call instead of using SET CLASSLIB by itself. Pass the name of the classlib to the routine. Have this routine attempt a simple SET CLASSLIB to the passed class. If it fails, have it determine the name of any EXE (using PROGRAM()), append the name of the exe to a string and using the string, attempt another SET CLASSLIB TO CLASSLIB.VCX IN EXE.

If it still fails, the class cannot be located and it fails.
Previous
Reply
Map
View

Click here to load this message in the networking platform