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!

Running a form from another

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I have a form which has a button on it which launches another form.
The second form is launched OK when the project is run in the dev environment but has stopped running in a built .exe.

I have placed wait windows in the load method and the activate method.

In the .exe - The load method is completed but the activate method isn't, how do I debug a .exe?


Keith
 
how are you launching the 2nd form from the the 1st form's buttons?

do form XXXX ?

Ez Logic
Michigan
 
This is invariably a sign that either the INIT is returning .f. or a control is failing to initialize. (Either will cause the form not to load.)

You can put SET STEP ON in any of the methods you want to step through and then DO the.exe from the command window.
 
how do I debug a .exe?

Not with WAIT WINDOWs - for reasons which I think we have discussed in an earlier thread.

Given that your aim is to figure out whether specifics events have fired, you could try [tt]SET EVENTTRACKING TO <filename>[/tt].

I've never done that from an EXE, but I can't see why it shouldn't work.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Command is:- DO FORM pagdesign
and it is in the button click method.

I was using the wait windows to quickly see how far it got.

When I issue set step on and launch the .exe from the command, the app works correctly.
I tried the event tracking thing by issuing:-
set eventtracking to 'd:/softftp/eventz.txt'
in the button before the 2nd form is called and it did not create a file, am I doing this correctly.



Keith
 
I tried the event tracking thing by issuing:-
set eventtracking to 'd:/softftp/eventz.txt'
in the button before the 2nd form is called and it did not create a file, am I doing this correctly.

Not quite. You need to do this:

Code:
SET EVENTTRACKING TO d:/softftp/eventz.txt  
SET EVENTLIST TO Load, Init, Activate   && List the events you want to track
SET EVENTTRACKING ON

&& now launch the form

SET EVENTTRACKING OFF

I forgot to mention that you need to actually set it ON and OFF, and that you also need to SET EVENTLIST.

Don't specify too many events to track, or your text file will be enormous.

You might need to come out of the EXE in order to open the text file, as it might otherwise keep it open behind the scenes.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
The directory d:/softftp exists? VFP never creates paths not existing, neither with SET EVENTTRACKING TO, nor with COPY FILE, COPY TO or STRTOFILE, first MKDIR or make sure the dir exists with DIRECTORY().

Eventtracking works at runtime, that shouldn't be a problem. Sometimes the file just appears after closing VFP, or the EXE. VFP caches files, so you might still not see them after SET EVENTTRACKING OFF, but only after existing the application. Also SET EVENTRACKING TO and ON should suffice, that would by default tack all events.

Within the exe you could also DO FORM formname.scx without any path, as the form is within the exe and no path is needed to find it. Unless you have excluded the form from compilation into the exe by mistake. But this can't be, as you see wait window from the load.

It's both load or init returning .f. cause the form not to launch.

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top