Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adjusting Screen Size
Message
From
27/08/2004 10:07:24
 
 
To
26/08/2004 15:34:32
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00933527
Message ID:
00936987
Views:
35
Marcia. Maybe this can shed some light. I found this so I assumed (yes, there's that word) that I would be able to do in Vfp since theres a way to do this via vb. It's kinda lengthy but.....:

below for methods to open FormFlow through VB

There are three ways to open a FormFlow form using a Visual Basic application. The first way to open a form is to use the Shell command. The Shell command is used to run the DFFILL.EXE executable program, with an optional parameter to have a form (.FRP), or form application (.FAP) opened also.

If the Shell function successfully executes the named file, it returns the task identification (ID) of the started program. The task ID is a unique number that identifies the running program. If the Shell function can't start the named program, an error occurs.

The Shell function runs other programs asynchronously. This means you can't depend on a program started with Shell to be finished executing before the statements following the Shell function in your application are executed.

If you had a Visual Basic form with a Command Button named Command1, you could attach the following code to the Click event of that button.

Example:
Private Sub Command1_Click()
strCommand = "C:\FORMFLOW\DFFILL.EXE C:\FORMFLOW\FORMS\EXPENSE.FRP"
lngReturnValue = Shell(strCommand, vbNormalFocus)
End Sub

This will execute the DFFILL.EXE executable file, and open a form named EXPENSE.FRP located in the C:\FORMFLOW\FORMS directory. If Filler is already running when the above Shell command is performed, then a second instance of DFFILL.EXE will NOT start, the first instance will become the active application.

The second way to open a FormFlow form using Visual Basic is to use the SendKeys statement. SendKeys sends one or more keystrokes to the active window as if typed at the keyboard. So, if FormFlow is the active window, you could send the keys of Alt+F, O, the Form name, and Enter. This would simulate opening the File/Open dialog, entering the form name, and clicking the OK button.

Example:
Private Sub Command1_Click()
SendKeys "%"
SendKeys "fo"
SendKeys "D:\software\ff215\lynne2.frp"
SendKeys "~"
End Sub

The third way to open a FormFlow form using Visual Basic is to use Dynamic Data Exchange (DDE). In this way, a DDE channel is setup for communication between Visual Basic and FormFlow.

To establish the DDE channel, a form must first be open in FormFlow Filler first to have as a LinkTopic. To open this first form, using the Shell command as described above is a good choice. You can then establish a DDE link to that form, and open subsequent forms using DDE commands.

Let's say you wanted to open two forms, EXPENSE.FRP and FAX.FRP.
Sample Visual Basic code to do this could be:

Example:
Private Sub Command1_Click()
strCommand = "C:\FORMFLOW\DFFILL.EXE
C:\FORMFLOW\FORMS\EXPENSE.FRP"
lngReturnValue = Shell(strCommand, vbNormalFocus)
Text1.LinkTopic = "dffill|expense.frp"
Text1.LinkItem = "FIELDA" 'FIELDA is a field on the EXPENSE.FRP form
Text1.LinkTimeout = -1
Text1.LinkMode = 1
Text1.LinkExecute "FileOpenForm ""C:\formflow\forms\fax.frp"""
Text1.LinkMode = 0 'Close Link
Thanks in Advance.

J. Turner
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform