bar
2007-09-24 11:12:10 UTC
//Plays Sound
void TfrmMain::Play_Update_Alert(void)
{
String SoundFilePath;
try
{
try
{
SoundFilePath =
ExtractFilePath(Application->ExeName)+"BIRD1.wav";
SoundFilePath = AnsiReplaceText(SoundFilePath,"\\","\\\\");
PlaySound(SoundFilePath.c_str(),NULL,SND_FILENAME);
}
catch(Exception &E)
{
ShowMessage(E.Message);
}
}
__finally
{
delete &SoundFilePath;
}
}
----------------------------------
Hello all
here is a function that plays sound from the source folder of .exe
I want to know how standard is the error handling or i need any changes for
better coding.
Thanks
SA
void TfrmMain::Play_Update_Alert(void)
{
String SoundFilePath;
try
{
try
{
SoundFilePath =
ExtractFilePath(Application->ExeName)+"BIRD1.wav";
SoundFilePath = AnsiReplaceText(SoundFilePath,"\\","\\\\");
PlaySound(SoundFilePath.c_str(),NULL,SND_FILENAME);
}
catch(Exception &E)
{
ShowMessage(E.Message);
}
}
__finally
{
delete &SoundFilePath;
}
}
----------------------------------
Hello all
here is a function that plays sound from the source folder of .exe
I want to know how standard is the error handling or i need any changes for
better coding.
Thanks
SA