|
|
|
Adding FlpGrf.OCX to Visual FoxPro
This document goes over the steps to create a basic project using FoxPro and how to distribute it and create an install. You can then use this outline to distribute your application.
1. From the menu, select File|New...
2. Select the Project option button, and click the New File icon.
3. In the Create dialog, click the Save button to save the proj1.pjx
4. From the Project Manager window, click Documents, then Forms, and click New...
5. Click the New Form icon.
6. Save the file as form1.scx.
7. Click the OLE icon in the Form Controls toolbox. Click on form1 and drag the outlines for the control.
8. The Insert Object dialog will display. Click Insert Control, and select FlpGrf Control from the Control Type list box. Click OK. Your instance will be named Olecontrol1.
9. Add a textbox to your form called Text1.
10. Add a button to your form called Command1.
11. In the Command1.Click
code window, add
THISFORM.Olecontrol1.LoadGraph = THISFORM.Text1.Text
12. Run the form to test it. Enter a number for a graph save file in the text box, and click Command1. The graph should appear in the control.
13. Now to build the exe. Select the Project Manager window, and select Project|Build... from the main toolbar menu.
14. Click the Build Executable option, and click OK. Click OK again to save the file as proj1.exe.
15. Now we need to create a directory where we put all the files to distribute before making the install. Make a directory called c:\distribute, and put the following files there: proj1.exe, Vfp6r.dll, Vfp6renu.dll, flpgrf.ocx.
16. Now to build the install. First create a directory for the image called c:\image.
17. Next, Select Tools|Wizards|Setup.
18. For Step 1, select the c:\distribute directory.
19. For Step 2, select Visual FoxPro runtime, and ActiveX controls. When the Add ActiveX Controls dialog pops up, select the FlpGrf Control, then the Close button.
20. For Step 3, select the c:\image directory. Then select your type of install (I chose Websetup only).
21. For Step 4, you will need to add some sort of text in the Setup and Copyright sections.
22. For Step 5, use the default settings.
23. For Step 6, make sure the ActiveX checkbox is checked for the FLPGRF.OCX.
24. For Step 7, I selected Generate a web executable file, then Finish. The exe will be in c:\image\webapp.exe.
Run the webapp.exe on a clean machine. The proj1.exe should run without problems.
Try the above steps to make sure you can at least do this minimum install. Then, for your project, make sure you are following the instructions in the FoxPro help. They are very specific on requirements. Some applications require that FoxPro be installed on the client machines; it depends on what your application does.
Now that you've inserted the control, click here to create your first graph, to familiarize yourself with the control.
![]() |
Last modified on: Friday, August 16, 2002