Article View: borland.public.cppbuilder.multimedia
Article #1240Re: Changing a PlaySound path name on the fly...
From: Yoto Yotov
Date: Sat, 11 Aug 2001 18:31
Date: Sat, 11 Aug 2001 18:31
26 lines
1704 bytes
1704 bytes
> Thanks, but now I get an "invalid pointer addition" message:
> if (X == 10) PlaySound(WinDir + "\\media\\jungle asterisk.wav", "",
> SND_ASYNC);
Here's how your code may look like:
String FileName(WinDir);
FileName += "\\media\\jungle asterisk.wav";
PlaySound(FileName.c_str(), NULL, SND_ASYNC | SND_FILENAME);
Note that your code assumes that this file exists. However, on most
systems (including mine), this file is not available. A more correct
approach is to use the user's default sounds such "SystemExclamation",
"SystemQuestion", "SystemHand", etc:
PlaySound("SystemExclamation", NULL, SND_ASYNC | SND_ALIAS);
But I leave that to you. By the way, additional information on
PlaySound can be found at:
http://www.bcbdev.com/faqs/faq54.htm
Good luck!
--
Yoto Yotov
Technical Details
Message-ID:
<MPG.15df44279eebbab89896c1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b736dcb$1_2@dnews> <MPG.15dd39c3e95d87759896ac@newsgroups.borland.com> <3b756607_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d0fc,c5d6b1e2caa77662 X-Google-Attributes: gid10d0fc,public X-Google-ArrivalTime: 2001-08-11 11:39:45 PST From: Yoto Yotov <yoto@NOSPAMgmx.fr> Newsgroups: borland.public.cppbuilder.multimedia Subject: Re: Changing a PlaySound path name on the fly... Date: Sat, 11 Aug 2001 14:31:56 -0400 Message-ID: <MPG.15df44279eebbab89896c1@newsgroups.borland.com> References: <3b736dcb$1_2@dnews> <MPG.15dd39c3e95d87759896ac@newsgroups.borland.com> <3b756607_1@dnews> X-Newsreader: MicroPlanet Gravity v2.30 NNTP-Posting-Host: 64.229.170.107 X-Trace: dnews 997554758 64.229.170.107 (11 Aug 2001 11:32:38 -0700) Lines: 26 Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews