Article View: borland.public.cppbuilder.multimedia
Article #1091acmFormatChoose fails
From: Werner Soekoe
Date: Thu, 18 Oct 2001 12:53
Date: Thu, 18 Oct 2001 12:53
54 lines
2617 bytes
2617 bytes
Hi
I'm trying to open the format choose dialog box within my application, using
the Windows API calls and source cose directly from MSDN on CBuilder 5 Pro.
When I run my app, and I click the button that is supposed to open die
dialog, my app goes into debug mode, showing the CPU window with the
assemebler code, and highlights the "ret" line just above
"ntdll.DbgUserBreakPoint". The code looks as follow:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
MMRESULT mmr;
ACMFORMATCHOOSE afc;
WAVEFORMATEX wfxSelection;
WAVEFORMATEX wfxEnum;
// Initialize the ACMFORMATCHOOSE members.
memset(&afc, 0, sizeof(afc));
afc.cbStruct = sizeof(afc);
afc.fdwStyle = 0L; // no special style flags
afc.hwndOwner = Form1->Handle; // hwnd of parent window
afc.pwfx = &wfxSelection; // wfx to receive selection
afc.cbwfx = sizeof(wfxSelection);
afc.pszTitle = TEXT("16 Bit PCM Selection");
// Request that all 16-bit PCM formats be displayed for the user
// to select from.
memset(&wfxEnum, 0, sizeof(wfxEnum));
wfxEnum.wFormatTag = WAVE_FORMAT_PCM;
wfxEnum.wBitsPerSample = 16;
afc.fdwEnum = ACM_FORMATENUMF_WFORMATTAG |
ACM_FORMATENUMF_WBITSPERSAMPLE;
afc.pwfxEnum = &wfxEnum;
mmr = acmFormatChoose(&afc);
if ((MMSYSERR_NOERROR != mmr) && (ACMERR_CANCELED != mmr))
{
// There was a fatal error in bringing up the list
// dialog box (probably invalid input parameters).
}
}
Why is it doing this? Does anyone know of any tutorial on the ACM that will
make any sense? MSDN gives some pretty screwed up information that I find
very difficult to comprehend.
Thanks in advance.
--
Regards,
Werner Soekoe
WernerS@fsl.gov.za
Technical Details
Message-ID:
<3bced146_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.media.kyoto-u.ac.jp!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d0fc,fb10d4ab5b96492f,start X-Google-Attributes: gid10d0fc,public X-Google-ArrivalTime: 2001-10-18 05:57:56 PST From: "Werner Soekoe" <WernerS@fsl.gov.za> Newsgroups: borland.public.cppbuilder.multimedia Subject: acmFormatChoose fails Date: Thu, 18 Oct 2001 14:53:38 +0200 Lines: 57 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 155.239.97.244 Message-ID: <3bced146_1@dnews> X-Trace: dnews 1003409734 155.239.97.244 (18 Oct 2001 05:55:34 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.media.kyoto-u.ac.jp!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews