473,378 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Thread Abort Problem (C#, Web Application)

In my application on the DropDownList_ItemIndexChanged 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.
Jan 22 '08 #1
5 2032
Plater
7,872 Expert 4TB
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.
Jan 22 '08 #2
yes, I tried with
mciSendString(stop, , , ) 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?
Jan 24 '08 #3
Plater
7,872 Expert 4TB
Webpage? What? This is an activeX object?
Jan 24 '08 #4
I am importing the "winmm.dll" in to my webapplication.
[DllImport("WinMM.dll")]
public static extern bool mciSendString(string lpstrCommand, string lpstrReturnString, long uReturnLength, long hwndCallback);
Jan 25 '08 #5
Plater
7,872 Expert 4TB
But that would be backend code, and the sound would only play on the server?
Unless it's activex?
Jan 25 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Gaetan | last post by:
Hi let this code : using System; using System.Threading; namespace ThisNamespace { class ThisClass
20
by: Doug Thews | last post by:
I ran into an interesting re-pain delay after calling the Abort() method on a thread, but it only happens the very first time I call it. Every time afterward, there is no delay. I've got a...
13
by: Andy Fish | last post by:
Hi, I am using COM interop to invoke MS word from my .net app. If word pops up a dialog box, my thread obviously hangs until the dialog is answered. Here's the problem: because the app is...
1
by: Ennixo | last post by:
hi, i coded an application in which i can move a slider to define a radius and it computes a gaussian blur in a thread. because the Scroll event of the slider is often raised, i use one thread...
5
by: [Yosi] | last post by:
Why I can't abot a susspended thread. Who can terminat a thread imediatly without consider to its stat or execution?
18
by: Urs Vogel | last post by:
Hi I wrote an application server (a remoting sinlgeton), where processes must be stopped in very rare cases, done thru a Thread.Abort(). Occasionally, and only after a Thread.Abort(), this...
4
by: fred | last post by:
I use a Synclock in a secondary thread and also stop the thread using the abort method. If the abort occurs while the thread is in the Synclock will the SyncLock always be released before the...
3
by: Chip | last post by:
I need to have an asynch thread abort itself. Something akin to a STOP. The thread that spawned it cannot access it so it must done within the thread. Chip
5
by: Alan T | last post by:
I will do several things in my thread: Copy a file to a location Update database record Read the file content Write the content to a log file If I call Thread.Abort(), it may be possible to...
7
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my Windows application, I'm using thread, and I've 2 questions: 1. I read that it's not recommended to use Thread.Abort(), so what is the best way to close the thread, in case the user...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.