General information
Category:
Coding, syntax & commands
>I am trying to find out if there is a way to execute a VB4.0 program fromVFP3.0.
>
>I have written a VB4.0 program (form, Class, Bas) which we want to incorporate in a VFP3.0 system. The user would click a command button and the VFP code will pass control information to the VB program for it to act upon. Once control has been passed to the VB app the user does have some interface with a form. Upon completion of the process the user will exit and needs to return to the next command in the VFP code.
>
>I have looked at making it an OLE server but this causes the process to be independent of the VFP3.0 system. I am not sure which direction to look at and was hoping for some advice. My knowledge of what VFP and VB offers to do this is very limited so all communication is welcomed
>
>Thanks..
I hope the following can help you.
First you declare in Visual Foxpro code a var just prior to execute the VB4.0 program which includes /N1, the name of your application in VB4.0 and the paramters you wish to pass like the following:
var = "/N7 VB40.EXE" + THISFORM.textbox.Value
After this, you execute the VB application with
RUN &var
NOTE: the VB application must be modal.
To reanude the VFOX application you need to test if the VB application is active. You can test with the Windows API, or with a flag or a file exists. While this file or flag exist you are in a DO WHILE loop with INKEY(0.xx).
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only