Article View: borland.public.cppbuilder.multimedia
Article #564Closing a MIDI device
From: George Mitchell
Date: Sat, 26 Jul 2003 21:36
Date: Sat, 26 Jul 2003 21:36
29 lines
1822 bytes
1822 bytes
I've got a program that uses the midi multimedia functions to communicate with external MIDI instruments. I can open a device and receive data, but I can't close the device when I'm done. My first code looked like: midiInStop(hMidiIn); midiInUnprepareHeader(...); midiInClose(hMidiIn); When I called midiInClose() I got a MIDIERR_STILLPLAYING return code. A bit of research in the help files revealed that any input buffers added to the device would cause this return error, so I modified my code to: midiInStop(hMidiIn); midiInReset(hMidiIn); ... wait for my 3 buffers to be returned midiInClose(hMidiIn); If I step through the code, all my buffers are returned, but now when I call midiInClose() it never returns, and I have to reset the program. Anyone got any ideas what is going wrong? Thanks in advance George
Technical Details
Message-ID:
<3f22f45d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d0fc,a80c7b8f5f55c3f4,start X-Google-Attributes: gid10d0fc,public X-Google-ArrivalTime: 2003-07-26 14:40:06 PST From: "George Mitchell" <george.m@currantbun.com> Sender: "George Mitchell" <george.m@currantbun.com> Reply-To: "George Mitchell" <george.m@currantbun.com> Subject: Closing a MIDI device Newsgroups: borland.public.cppbuilder.multimedia X-User-Info: 80.47.205.81 80.47.205.81 NNTP-Posting-Host: 207.105.83.65 Message-ID: <3f22f45d$1@newsgroups.borland.com> Date: 26 Jul 2003 14:36:29 -0700 X-Trace: newsgroups.borland.com 1059255389 207.105.83.65 (26 Jul 2003 14:36:29 -0700) Lines: 29 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail