CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Eri523

Search: Search took 0.07 seconds.

  1. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Thanks for correcting my code, Arjay. Great work, really invaluable! :cool: And your implementation is so pretty straightforward. I couldn't imagine that it could be done that simple. :)

    After...
  2. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Yes, well, the two are related, however: The assertion failure is caused by a wait on an EventWaitHandle that is supposed to be set by the BackgroundWorker (more particular: its RunWorkerCompleted()...
  3. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    No. I'll attach an updated one to this post and remove the one from the previous post.

    Please let me know if it contains any unwanted files, so I can adjust my clean-up settings.

    As I already...
  4. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Oops! :o I tried to reduce the amount of code posted. Maybe I reduced a bit too much...

    bw is a BackgroundWorker ^, passed as a parameter to DoCountWorker() from the worker event handler:


    ...
  5. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Like that:



    System::Void Form1::DoCountWorker(FileStream ^fsInfile,BackgroundWorker ^bw,DoWorkEventArgs ^e)
    {
    BinaryReader brInfile(fsInfile);
    const int nBufferSize=512;
    array<Byte>...
  6. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    This doesn't help either. Without wanting to doubt your expertise, I didn't put much hope into this change anyway: The problem is not restoring the original cursor, but getting the wait cursor...
  7. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    I thought I'd already tried that, but to be sure I tried it again, following your advice as close as possible.

    I replaced the two assignments to the form's UseWaitCursor property in the method...
  8. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Well, I already was afraid of something like that some messages up the thread... :(

    But I promise it will be marked resolved soon. Soon, however, not now... :p



    Yes apparently this is...
  9. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Ok, now that I'd waited 1+ week for getting additional insights from here without success, I resorted to a Google search for "BackgroundWorker RunWorkerCompleted not called". Although I didn't expect...
  10. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Thank you for your effort Arjay, both backward and forward in time. :)

    I have attached the zipped project in question. I did a clean-up on the project before zipping it, so I hope it doesn't...
  11. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Well, in the meantime I've gathered some more information about this issue. (But they're really few as I'm still short of ideas.)

    But first let me pick up the following statement from my own...
  12. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Ok, then I don't think I need this extra check. Processing can be restarted easily by just clicking a button and picking a file in a file open dialog. In the current version, processing of the 731 MB...
  13. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Ah, yes, of course, sorry... :o The screen shot you are referring to is a few versions of the app back. I have attached a current one to this post. (I hope this doesn't look like image overkill Ã* la...
  14. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    The X button issue is solved now. :) I found the solution "by accident" among the results of a forum search I did for a completely different reason.

    The solution is: Set the form's ControlBox...
  15. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    It already has one. :)



    Nice idea, but I think I'll only implement that confirmation for the X button. Asking that after the user pressed the explicitly labeled Cancel button too much looks...
  16. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Actually, I was uncertain about that too. But how should I hande it then? Simply continue processing without the progress display (and the oppotunity to cancel the operation after that)?
  17. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    This is the way it is implemented right now. However, there is only a single call to Application::DoEvents() right at the end of the outer one of the two nested core loops, and that seems to be...
  18. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    This looks like it would solve the re-entry problem in an elegant manner and also would be another nice feature upgrade. :cool:

    I have added a progress dialog to the app that you can see in the...
  19. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Would disabling the form automatically affect all the child controls or would I have to do that explicitly for every individual control?



    This might be simpler if I can do that in a single,...
  20. Replies
    39
    Views
    75,433

    Re: How to UseWaitCursor correctly

    Ok, now that I have also encountered repainting problem with that app after writing my OP, I tried adding a call to Application::DoEvents() inside the loop. Now the wait cursor is shown correctly and...
  21. Replies
    39
    Views
    75,433

    [RESOLVED] How to UseWaitCursor correctly

    I have a Windows Forms app that does a lengthy calculation in a button's click handler. So I set the form's UseWaitCursor property to true when I start the calculation and reset it to false when I'm...
Results 1 to 21 of 21





Click Here to Expand Forum to Full Width

Featured