Can you create an .exe file from created form?
Can you create an .exe file from created form?
(OP)
Hi everyone, im doing a little project, i designed a form using form designer.. is it possible to create an exe file out of it? If so, please teach me how… thanks in advance…
RE: Can you create an .exe file from created form?
Chriss
RE: Can you create an .exe file from created form?
The usual approach would be for the project to also contain a program (a PRG file), and for that program to launch the form. However, it is also possible for the project to contain the form and nothing else. In that case, set the form to "Main" (right-click on it within the project, and tick "Set Main"; the name of the form will turn bold). You can then buidl the project to create an EXE.
If you do that, be sure to make the form modal (set its WindowType to 1). Otherwise, the form will simply flash on the screen and then immediately disappear and terminate the program.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads
RE: Can you create an .exe file from created form?
I see only an unfortunate way how that works, Mike. With the _SCREEN visible.
Because the form has to be modal as you don't want a PRG that could have a READ EVENTS. The form can't be top level, or setting it modal does not work.
So you need to set the form to be in screen or in top level form and when you add a config with SCREEN=OFF or set _SCREEN.visible=.f. in your form code (load or init), then the form disappears.
I only see this working with another top level form or screen and since that's surely not what you want, you better have a main.prg as usual.
Chriss
RE: Can you create an .exe file from created form?
RE: Can you create an .exe file from created form?
Form init:
CODE
Form queryunload:
CODE
And ShowWindow set to 2, which means as top level form.
Then this works without a PRG, but you never return from init, the whole time the form runs, an event hasn't finished. READ EVENTS allows any further events to happen, but it's not natural to do this. It doesn't feel good, as you have to actually call the Show() method, which is happening after init, usually, but not in a case you stop init from exiting by READ EVENTS.
As you have to use a top level form anyway, and that's never modal, I'd also just have a PRG that can initialize several things and then READ EVENTS. It's also much easier to extend.
Chriss
RE: Can you create an .exe file from created form?
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads