Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple threads in VFP 6.0
Message
From
30/11/2001 03:02:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00587582
Message ID:
00587864
Views:
30
This message has been marked as the solution to the initial question of the thread.
John,
Yes menu.exe is the dispatcher and something like windows' "programs" menu (in my version I used images and text on form to make it nicer - like Outlook's side menu). It's toplevel and not related to app.exe in any way. Just calls it with a parameter and 'each' app.exe that's called is in its own thread. IOW user can call app.exe with 'option1' and w/o waiting it to close could call app.exe with 'option2' or again with 'option1'. Since it's a multiuser ready app, simulating it on only one machine doesn't harm :)
Yes you got it right, each seesion could be accessed from taskbar, alt+tab switching (and I had a 3rd option of from dispatcher menu but it's not as easy as others).
ShellExecute works wonderfully for this job. Say you have 3 exes with code :

*Exe1 - main.prg
LaunchExe2
LaunchExe3
Do form aform

*Exe2 - main.prg
ltStart = datetime()
do while datetime()-ltStart < 86400
*do nothing for 1 day-except wasting CPU cycles!
enddo

*Exe3
do form someform

When exe1 is run it ShellExecutes the other 2 and launches a form - all is up and running in 1-2 secs. It's as if you ran them separately from 3 different shortcuts :)

PS: But again in my case it really had to be that way. Normally modeless forms is the usual way :)
Cetin

>Cetin,
> great idea. Let me see if I understand how this works. menu.exe starts and calls app.exe when user hits selection. 1st instance of app.exe is running. User is in model form in app.exe. I assume the menu is still visible or does user have to switch back to menu.exe? When user hits menu selection (while running app.exe?) a new instance of app.exe starts. How does user get from one session to the other? I assume that you now have two separate copies of VFP running and can click on them on the task bar or use alt+tab. Do I have this right?
>
>By the way, this is not the 1st time you have helped me and I really appreciate it!
>
>John.
>
>
>>>Hi all.
>>>Our app has always allowed a user to be in only one place in the program at one time. We never allowed a user to jump from say A/P to A/R. We are now getting requests from the users saying they would like to be able to keep one window open and start another window in another section. ie Customer calls and wants his AR balance while user is in AP.
>>>
>>>We use a totaly modified _sysmenu but turn it off after the user has made a selection. I tried leaving it on but all selections are disabled. I assume it is because we use only modal windows. What I would really like to do is something like start up to 5 sessions when VFP is started and allow the users to jump from one to another. The only way I can see to do this right now is to actually start a new copy of VFP each time they need to jump to something else. ( I assume I could use run /n.)
>>>
>>>Right now I am looking for ideas in an area I have little experience in. All ideas are welcome.
>>>
>>>Many thanks in advance.
>>
>>John,
>>A modeless system would be good. Anyway for a very specific app I needed similar 'one way ticket' model and what I did was to create 2 exes. One is the menu server. Other is rest of the app accepting a parameter as the menu option.
>>Something like menu bar click has : Launch(2)
>>and would call myExe with '2' as the requested option. Instead of run /n I used ShellExecute() and it works perfectly.
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform