Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Fxp From Exe With Access to Forms

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
I have been using a form to let users run small external utility programs I send them through email. They drop the fxp in the "Util" folder and my app displays all of the fxp's in that folder in a listbox and allows them to pick one to run. I have had no problem with running any of these until I referenced a my "MesssageForm" form in the Fxp. This form is included in the project. Fox throws an error saying it cannot find the form. If I indirectly access the form through a procedure in my main procedure file, everything works fine. I don't mind doing this, but thought the external fxp would be able to use the "MessageForm" directly because it is contained in the exe. It seems strange that the external Fxp has acccess to the procedures in the "Set Proc To' files, but not the forms in the exe. Probably just my lack of understanding of how the app knows what it can use. Is there a better way to do something like this? Is there a way to make the forms visible to the Fxp? FYI: These utility programs can also be set to run automatically when the program starts and also be self deleting. This is VFP 6.0. Moving app to VFP 9 soon.

Thanks,
Auguy
 

In all probability it is a PATH problem since the FXP file is in a different directory than the main EXE file. Include the path of the main exe in the FXP program with the SET PATH TO EXEDIRECTORY command.

 
Thanks to both of you. I tried both suggestions with no luck. Any other ideas?. I will continue to experiment to see if I can find a way to use the forms contained in the exe. Still seems strange that I can't run the form directly, but I can call a procedure in my main proc that runs the form without any problem. Am I missing a setting within the project or something ?

Auguy
 
If there really is a problem running forms directly in an exe from an external fxp file (which I have not been able to check), one option would be create a generic procedure to run forms in your main procedure file with the following code

procedure runform
parameter lcform

do form (lcform)

Run the code do runform with 'FORMNAME' in your FXP file.



 
There are replies in your thread on the same topic in UT.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top