Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class ProgressIndicator FAW
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01019151
Message ID:
01019169
Views:
32
This message has been marked as the solution to the initial question of the thread.
Hi Randy,

I'm assuming from your code that you are using the progressbar as a class that is not compiled into a COM Server. Take that class (making sure it is OLEPublic still) and place it into a prg file in a seperate empty project. Then, compile your new project as a COM Server (EXE) in VFP. So, let's say your COM Server exe is named "progress.exe"... then you can instantiate it from your main application using loProgress = CreateObject("Progress.ProgressIndicator") - the code from your main application is little different than what you have now except for this change in how it gets instantiated.

The deal is, that when a VFP application is crunching really hard on a single line of code (such as your select statement), progress bars tend to just freeze up, like you're seeing. It's because VFP is so busy processing the Select Statement that it doesn't have time to execute the timer events. That's why the progress bar is designed to be compiled as a COM Server. This allows Windows OS to handle the processing and your progress bar will get CPU cycles and other system resources it needs to run smoothly since it is a seperate process and Windows won't give your main application all of them.

>Hello Craig,
>
>I've taken a liking to your ProgressIndicator class that you published in a FAQ here on the UT (http://www.levelextreme.com/wconnect/wc.dll?LevelExtreme~2,84,14,27458). This is a nice looking all-VFP soultion, and easy to understand, even for an ameteur like me.
>
>The change to make it work in VFP7 was near painless - a new static gif and a few minor tweaks for color and size.
>
>I took the example from the FAQ article and it ran fine. When I dropped it into my app, the window show()s, but no moving boxes action:
>
LOCAL loProgress
>loProgress = CREATEOBJECT("ProgressIndicator")
>* PARAMS: caption, min, max, initial value, undetermined, cancel button
>loProgress.setup("Selecting Data...", 1, 1, 0, .T., .F.)
>loProgress.show()
>=INKEY(10,"H") && This works, but 'real' code does not
>RELEASE loProgress
>I have about 50 lines of code (2 SCANs and a SELECT ... UNION) that takes about 10 seconds to execute. I removed the =INKEY(10,"H") and placed the RELEASE after all the data munching stuff, and just before the REPORT FORM ....., hoping to hypnotize my users with a classy looking progress bar.
>
>So, where have I gone wrong?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform