devxlogo

Creating an Executable File from a Project

Creating an Executable File from a Project

Question:
I copied my executable file and the VFP6R.DLL, VFPRENU.DLL, FOXUSER.DBF and FOXUSER.FPT files to my user’s PC. When I try to run it, the screen form flashes and the program just quits.

What am I doing wrong?

Answer:
The problem you are experiencing is not related to the DLLs; it is happening because you need to create an event loop that holds the executable in memory.

VFP has a command called READ EVENTS that creates an event loop for you, and another command called CLEAR EVENTS that ends the event loop. In your main program, execute a READ EVENTS after everything in the application is set up (e.g., menu, mainform, etc.). That will keep the application in memory. Then put a CLEAR EVENTS in the code that quits the application (e.g., in the menu code for File/Exit).

In regard to the DLLs, you should not just copy DLLs to another machine. There are registration issues as well as file dependencies that can cause problems. Use the wizard that ships with VFP called the Setup Wizard, which builds installation programs for you. It knows what DLLs need to be included and even registers them for you.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist