1
votes

I have a simple vfp project with one program (ppp), and one form (ppp). The form is an empty form, and the progran contains this:

SET DELETED ON 
SET DATE TO DMY 
SET SAFETY OFF 
_screen.visible=.F. 

DO FORM ppp

READ events
RETURN

I build the project to an .exe using the project manager and no errors appear, and I can execute the .exe from the main FoxPro window without any problem.

However, when I double-click the exe from Windows nothing happens. What am I doing wrong?

3

3 Answers

5
votes

By default the ShowWindow property of a form is set to 0 - In Screen. This means that the form is shown in the main VFP screen. However, _screen.visible=.F. hides the screen so you can't see the VFP screen, or your form.

You can set _screen.visible=.T., but you'll see the main VFP screen, with your form in it, which you may not want.

You can also set the ShowWindow property of your form to 2 - As Top-Level Form, which means it will display outside the VFP screen and on the windows taskbar. In that case, you'll still see your form even if you hide the VFP screen with _screen.visible=.f.

ShowWindow property

1
votes

You need vfp9r.dll and vfp9renu.dll in the exe path unless you have vfp installation.

1
votes

I have to learn VFP because I want to move to my company's development sector and they have some products written in VFP, eventually I got stuck into this problem too. But I found the way to do it properly.

You need to initialize the event processing loop like this.

DO FORM ppp
READ EVENTS

Source: http://msdn.microsoft.com/en-us/library/aa975719(v=vs.71).aspx

[Note] Sorry about my bad english, I am Brazilian.