ProgressBar with dll/class function
Hi.
I have an app. that uses a function. This function returns an integer value of processed documents. So, my problem is: I use a ProgressBar to show the number of processed documents.
Code:
Proc.ProgressBar1.Value = Motor.Process(... ... ...
The "Motor.Process" function is returning integer values but I can't refresh the progress bar. I'm using DoEvents before and after the function call.
Thanks
Re: ProgressBar with dll/class function
Is this part of a loop - the function being called multiple times, with the return value increasing each time?
What is the Maximum value for the Progressbar? If it is too high, you wont notice the difference until many documents have been processed.
Try using this (after setting the value) to force a re-draw:
Code:
Proc.ProgressBar1.Refresh
DoEvents
Re: ProgressBar with dll/class function
The number of documents may vary, from 1 up to 20
I've tryed the refresh before and after, but it won't work as expected.
Re: ProgressBar with dll/class function
By definition, it could only work after.
To be able to work out why it isn't working.. What are the answers to my questions?
Re: ProgressBar with dll/class function
Sorry...:o
Let me explain you how the dll function works.
I'm sending an adodb.Recordset to the dll. There, I execute a loop (for processing all rows in my RS). While the dll is processing the entire RS, I return to the function the number of RS rows processed:
Code:
i = i + 1
class1.Process= i
In my app I call the function only 1 time.
Thanks.
Re: ProgressBar with dll/class function
Ok... you call the function once, and the value gets returned when the function is finished.
By definition, your program cannot know the progress, or run any other code.
Without making major changes to the code (in this program and/or the DLL), there is no way of adding any kind of progress indicator.
Re: ProgressBar with dll/class function
Ok, I'll accept that.
I'll try using that avi of copying files.
Thanks.