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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mix .EXE and .APP - problem with showing report

Status
Not open for further replies.

darjo

Programmer
May 6, 2013
3
SI
Hello!

I have a problem with showing reports in Visual FoxPro.

My application consists of an .exe file which contains most of the code and an .app file that I run on start to add some more functionality accessible via a menu.
Each of these two files have reports included in them.

When I tried to show a report from the code in APP I got a File not found error. As a workaround I've excluded the report files from the APP project and placed it somewhere on the disk. So when I create a report I use it's physical location on the disk. And this works.

What also works is if I show a report first from the EXE code and then from the APP code.
What doesn't work is if I show a report first form the APP code (it shows as expected) and then from the EXE code later (I get a File not found error).

The solution would be to exclude ALL the reports from both projects and put them on the disk but that would be extremely impractical.

Does anyone have any ideas what could be causing this?
 
VFPs default search order for files is inside the EXE first, then on disk in several folders. As you start the EXE that is the main process. Makes me wonder if you ever find any report inside the APP just by REPORT FORM. If you DO some.app that doesn't start a new process, it runs in the same process, same screen.

Usage of an APP should rather be as a library of classes, you can use the complex parameterisation of NEWOBJECT to instanciate a class of a classlibrary in an APP file, as you can specify all three things, class, library and app file. You can DO some.prg in some.app. But don't expect a prg with a REPORT FORM some.frx to search for some.frx inside the APP file. The least thing you should do is not put same named reports in EXE and APP. Same applies to any file type.

As a conclusion I would put FRXes only inside the EXE or on HDD, but never in the APP. What VFP can manage is to find the parent classes or the whole class hierarchy put into several vcx libraries in the APP, that's simply possible, as each class points to it's parent class (or the native base class). But DO some.app is not adding the APP file and all files inside it to the internal file search, so you can't make use of the usual file search mechanisms.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top