1

I have a static progress bar that I'd like to advance during external code execution.

       [DllImport("netapi32.dll",EntryPoint="NetServerEnum")]
    public static extern int NetServerEnum( [MarshalAs(UnmanagedType.LPWStr)]string servername,
        int level,
        out IntPtr bufptr,
        int prefmaxlen,
        ref int entriesread,
        ref int totalentries,
        SV_101_TYPES servertype,
        [MarshalAs(UnmanagedType.LPWStr)]string domain,
        IntPtr resume_handle);

Is my call to my external function. This function takes quite a while to process on large networks as you might imagine so a progress bar would be nice. Anyone have any ideas?

THanks!

coderego
  • 33
  • 4
  • You need to hook up a callback function that periodically returns status. Or, you can call another external function periodically and have it return a percent completed. – Robert Harvey May 12 '11 at 16:18

1 Answers1

0

If you can modify the external method, you could add a callback to update progress. If not, you may have to just add an indeterminate state progress bar, as I'm not sure how you would otherwise obtain progress (let alone communicate it).

ermau
  • 1,303
  • 7
  • 19