Thread Abort Problem (C#, Web Application)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • universe
    New Member
    • Oct 2007
    • 17

    Thread Abort Problem (C#, Web Application)

    In my application on the DropDownList_It emIndexChanged event I am Playing a Audio File (using winmm.dll) in a Thread.
    Though I stop my application audio is getting played till completion.

    But My Requirement is to stop that audio file when the user clicks a button and also when the application is terminated.

    I thank u all,
    kiran.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Do you ever tell the audio to stop playing? These are API calls right, so you would need to actually tell it to stop instead of just changing it.

    Comment

    • universe
      New Member
      • Oct 2007
      • 17

      #3
      yes, I tried with
      mciSendString(s top, , , ) method. But audio file playing is continued.

      is it possible to stop audio file when the web page is getting closed ? how can I do that?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Webpage? What? This is an activeX object?

        Comment

        • universe
          New Member
          • Oct 2007
          • 17

          #5
          I am importing the "winmm.dll" in to my webapplication.
          [DllImport("WinM M.dll")]
          public static extern bool mciSendString(s tring lpstrCommand, string lpstrReturnStri ng, long uReturnLength, long hwndCallback);

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            But that would be backend code, and the sound would only play on the server?
            Unless it's activex?

            Comment

            Working...