Whats the MP equivilent of Application.DoEvents(); (1 Viewer)

egonspengleruk

Retired Team Member
  • Premium Supporter
  • June 30, 2005
    250
    0
    In my MP3 ripping code, I have code that hogs the CPU for large amounts of time causing the entire MP screen to white out. In the original code there are lots of DoEvents calls, but MP seems to not like me using these.
    What method should I be using to let the rest of Windows operate while my code runs.

    Egon
     

    egonspengleruk

    Retired Team Member
  • Premium Supporter
  • June 30, 2005
    250
    0
    samuel337 said:
    Should you be using threading for that - running the CD ripping thread on a different one to the UI one so that the UI continues to work...

    I guess if you've fixed it now, it doesn't really matter.

    San

    It would probably be a good idea......but this is just my first mock up to prove it all works.
    Do you have any links or example code that demo's threading in C#? Im learning as I go here :)

    Egon
     

    samuel337

    Portal Pro
    August 25, 2004
    772
    0
    Melbourne, Australia
    I don't have any great examples - I'm a VB.NET guy learning C# so I know how to do it, but I don't have any great examples.

    You could check out the code that MP uses to update the database within MP or the code that MP uses to update the TVGuide - both those use threading.

    Sam
     

    MrSensitive

    Portal Pro
    May 18, 2004
    239
    0
    Belgium
    Hi,

    the easiest way is to use a backgroundworker..
    Visual studio 2005 has one ready in the toolbox.
    it wraps all the threading stuff in a nice package.. and is very easy to use..

    (i'm using a custom one in my pocketpc application to poll the server every second)
     

    Users who are viewing this thread

    Top Bottom