Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menus and VFP7

Status
Not open for further replies.

mpgalvin

Programmer
Feb 5, 2001
119
IE
2 distinct problems, but I figured I'd save myself some typing...

1. I created a menu with the menu builder, then copied the generated code to the Init procedure of my form. It works fine in design, but when I click on any option after building, it falls over, unable to find the form I'm calling. Where should I be putting DEFINE MENU statements to get this to work properly in both modes?

2. Is anyone using VFP6 and VFP7 side by side (in perfect harmony) on their machine? We've just bought it, but I'm reticent to install it in case VFP6 goes all strange on me. I need to have VFP6 installed (for the time being, at least) so that I can support our Win95 users. Is there any issues with compiling a project in both versions? Am I just opening myself up to a world of pain?
 
Hi!

1. How you access the form from the menu? There are many approaches. The best one is use the THISFORM - when menu is created inside of the form method, thisform is accessed correctly. Then, you can assign the reference to form to the public variable and access your form using that variable. You can use _Screen.Forms collection to access any form currentlyopened, access active form etc. DO NOT use the form name to reference a form. The variable with name matching to form name is created only in design time for debugging purposes to quickly access a form and see its properties in the Watches and Locals debugging windows.

2. For users you do not require to install VFP on each user machine. Just install run-time libraries for VFP6 and VFP7 (DLL files have different names for different versions) in the system32 folder (or system folder in W95), and EXE file created by VFP will work there.
Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Vlad, thanks for the responses:

1. I figured it was something like the forms I'm referencing from the menu don't exist at the time I'm referencing them (main form.Init), so I need to move the menu def'n from there to somewhere else. but where? Since this is only an exe problem, I want to avoid moving it, building it, sending it to the customer, checking if it's right, etc Pain for me, extreme pain for customer. So where should I define my menu so that I can reference other forms in the project (as in "on selection bar x of menu do form formname")

2. I need VFP6 installed on my machine so that I can make VFP6 setup files with all the accompanying DLLs. Surely VFP7 setup wizard will use VFP7 DLLs? So I just need to know will the 2 sit side by side on a machine with no complications?
 
1. Strange. Just a suggestion: If formname is included into the project, it will be included into the EXE file, so you will be able to use it in DO FORM command - check if it is included. Well, if menu is a program that is not compiled into EXE, I do not know... Check also if some other module in the project do not have the same name as the formname. If have, use 'formname.scx' instead.

2. I don't know exactly, but why you need a setup for VFP6 version? Is there any difference? When you build the EXE file, build it using latest version and it is better to distribute it with latest runtimes. Why you neede EXE version for VFP6?
Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
1. The strange thing is that aswell as the menu def'n I have image command buttons to do the same thing (company orders) and they work perfectly (same code).

2. I'm just worried that VFP7 is Win98+ only which means either we force customers to upgrade or not sell it to them at all.
 
From what I know, VFP7 should work ok on W95 machine with service pack update - probably you can find this information at the MS site or i the help file. SP for W95 appeared after W2K released. It is recommended also to install DCOM95 on W95 machine for reliable work of VFP 6 applications.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top