Results 1 to 7 of 7

Thread: ProgressBar with dll/class function

  1. #1

    Thread Starter
    Hyperactive Member RS_Arm's Avatar
    Join Date
    Mar 2007
    Location
    Planet Earth
    Posts
    282

    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

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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

  3. #3

    Thread Starter
    Hyperactive Member RS_Arm's Avatar
    Join Date
    Mar 2007
    Location
    Planet Earth
    Posts
    282

    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.

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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?

  5. #5

    Thread Starter
    Hyperactive Member RS_Arm's Avatar
    Join Date
    Mar 2007
    Location
    Planet Earth
    Posts
    282

    Re: ProgressBar with dll/class function

    Sorry...
    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.

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  7. #7

    Thread Starter
    Hyperactive Member RS_Arm's Avatar
    Join Date
    Mar 2007
    Location
    Planet Earth
    Posts
    282

    Re: ProgressBar with dll/class function

    Ok, I'll accept that.
    I'll try using that avi of copying files.
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width