Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modal Form
Message
From
10/11/2001 07:33:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/11/2001 07:10:33
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00580101
Message ID:
00580120
Views:
19
>Cetin,
>
>I will give you a little more detail. This app is an electric sign-off process for engineering changes. When the initial writer attemps to approve a change(submitt it into the sign-off cycle) the first thing that happens is I check to see if a pdf file exists for this drawing so it will be viewable to all in the sign-off cycle. If it does not exist a run command is envolked to process each sheet of the drawing into a .ps file(another support app takes it from here to do the pdf work). This is the process that takes a variable length of time depending on the size of the drawing. Remember I need the approval button to wait for all this before saying ok the change can move to the next stage. Now if I have a modal form that pops up and automatically starts the .ps process and at the same time start a progress bar I have trouble. How do you get two timers to run similtaneously? And how could I get the progress bar to show even an estimated progress time?

Steven,
You might not show the progress bar. You might however either show an estimated progress or periodically give feedback say by showing an elapsed counter so user at least would have an idea computer was ot hung (I generally do if no feedback and it takes longer than 5-10 secs)

Estimated progress bar doesn't need to show a correct estimate (as many Windows installation bars:)
I don't see 2 timers here so don't have an idea for second timer. If really there was they could coexist or you could use Bela Bode's CPPTIMER from download section. It lets you run multiple timers.

For the just one timer I see (progress bar) I actually won't use a timer. For a similar thing I created a FLL that launches the external program via ShellExecute and tracks it :
declare short ShowWindow in win32API integer nHwnd, integer nShowType
declare short IsWindow in win32API integer nHwnd
declare Sleep in win32API integer SleepTime
declare integer GetWindowText in win32API ;
  integer hWnd, string @ lpString, integer nMaxCount
declare short SetForegroundWindow in win32API integer nHwnd

set library to AppLauncher.fll additive & this is my FLL that shelexecutes
&& and returns process hwnd 
lnHwnd = RUNAPP(tcAppName, tcParams, tcWorkDir)
if lnHwnd = 0
 return && Not luanched
endif
lpString=space(256)
do while IsWindow(lnHwnd) # 0 ;
	and GetWindowText(lnHwnd, @lpString, 256) # 0
	Sleep(5000) && Do nothing for 5 secs - this one as a timer
enddo
Now assuming you solved timer problem here is how you would show an estimated time :
thisform.pBar.Max = lnEstimatedTimeInSeconds
*...

Sleep(lnSleepSeconds*1000)
* Timer fired
thisform.pBar.Value = min(thisform.pBar.Value+lnSleepSeconds, thisform.pBar.Max)
As installations do you could wait after max is reached (or show at somewher about %99). It'd be as real as installations do.
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
Reply
Map
View

Click here to load this message in the networking platform