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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing variable to VB app

Status
Not open for further replies.

sdpsc

Technical User
Feb 10, 2001
76
How do I pass a variable from a FoxPro app to a VB app? Thanks.
 
If the VB app accepts parameters, you could use ShellExecute():
Code:
DECLARE INTEGER ShellExecute IN shell32.dll ;
  INTEGER hndWin, ;
  STRING cAction, ;
  STRING cFileName, ;
  STRING cParams, ;  
  STRING cDir, ;
  INTEGER nShowWin

cFileName = "MyVBApp"
cParams   = "Parm1, Parm2"
cDir      = "C:\WhereverMyVBAppIs"
ShellExecute(0, "open", cFileName, cParams, cDir, 1)

-Dave Summers-
[cheers]
Even more Fox stuff at:
 

It depends how you are executing the VB app. If you are using COM Automation, you pass them as normal VFP data types.

For instance, if the VB server expects a boolean, just pass a logical. And so on. VFP will handle the translation.

If the VB app is a normal DLL (not COM), then you will have to DECLARE it in VFP. You also have to worry about the different data types. If that is what you are doing, please supply some more information, and I (or someone) will be able to give you some guidance.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top