0
votes

I am beginner in using Visual FoxPro. I am trying to create a simple application which contains a form with a few textboxes. The problem is that the application window does not appear when I run the executable file which I build.

The code for the program is:

PROCEDURE main_app

_SCREEN.Activate

_SCREEN.WindowState = 2
_SCREEN.backcolor = RGB(128, 128,  ;
                128)
_SCREEN.Caption = ""
_SCREEN.refresh()

SET TALK OFF
SET DELETED ON
SET EXCLUSIVE OFF
CLEAR ALL
CLEAR
CLOSE ALL

DO FORM simpleform LINKED
READ EVENTS
RETURN
*MESSAGEBOX('Msg')

ENDPROC

In the form I have a few textboxes and a button. When the button is clicked then some code is executed. If I run the application from the IDE everything works fine but if I create the executable this does not display any window, still the process appears in the task manager. If I uncomment the MessageBox then this will appear even if I run the exe file. I don't know a way to trace the problem outside the IDE, maybe there is still a library needed that I am not aware. I am using Visual FoxPro 9.0

Would someone be able to help me out?

If you can provide me with a link to a very simple application exe which uses just one form and finishes when the form is closed I would very much appreciate it.

Thanks in advance

2

2 Answers

0
votes

I tried creating a brand new project, new code and new form just as you described. I copied your code and ran, but it never displayed the form.

If this is the main app in your project, you don't need the initial

PROCEDURE main_app

just remove this line as there is nothing CALLING the "Main_App" and thus is never getting called to ultimately call your form.

Just comment it out, save your project and run it... See what you get, it SHOULD work.

** PROCEDURE main_app
0
votes

The problem was that I did not set the screen visibility to true.