Article View: borland.public.cppbuilder.multimedia
Article #565Re: Closing a MIDI device
From: Maynard Philbrook
Date: Sun, 27 Jul 2003 03:43
Date: Sun, 27 Jul 2003 03:43
39 lines
2278 bytes
2278 bytes
Try to use the Disconnect.
George Mitchell wrote:
> 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
--
To See what real programmers do in their spare time visit
http://jamie12.home.mindspring.com
home of PC bit software ..
Please send comments about my work .
Technical Details
Message-ID:
<3F234A5D.CE9F26EF@mindspring.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mailReferences:
<3f22f45d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d0fc,a80c7b8f5f55c3f4
X-Google-Attributes: gid10d0fc,public
X-Google-ArrivalTime: 2003-07-26 20:46:55 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail
From: Maynard Philbrook <UseThis.jamie12@mindspring.com>
Newsgroups: borland.public.cppbuilder.multimedia
Subject: Re: Closing a MIDI device
Date: Sat, 26 Jul 2003 23:43:25 -0400
Organization: MindSpring Enterprises
Lines: 41
Message-ID: <3F234A5D.CE9F26EF@mindspring.com>
References: <3f22f45d$1@newsgroups.borland.com>
Reply-To: UseThis.jamie12@mindspring.com
NNTP-Posting-Host: 42.a8.28.eb
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Server-Date: 27 Jul 2003 03:46:54 GMT
X-Mailer: Mozilla 4.5 [en]C-CCK-MCD {TLC;RETAIL} (Win98; U)
X-Accept-Language: en