home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!hal.com!decwrl!deccrl!bloom-beacon!eru.mt.luth.se!lunic!sunic!news.funet.fi!uta!jere
- From: jere@uta.fi (Jere K{pyaho)
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: Weird problem with MMAPI and STRICT
- Message-ID: <6447@kielouta.fi>
- Date: 26 Aug 92 06:27:49 GMT
- Organization: University of Tampere, Finland
- Lines: 36
-
- Can anyone figure out what is happening here:
-
- This is Win3.1, Borland C++ 3.1. I have the following, very
- simple piece of code, written in straight C, which uses the
- Windows 3.1 Multimedia API:
-
- #include <windows.h>
- #include <mmsystem.h>
- ...
- HMIDIOUT hMidiOut; /* handle to MIDI output device */
- UINT uiMidiOut; /* MIDI output device ID */
- int iReturn; /* call return value */
-
- iReturn = midiOutOpen( (LPHMIDIOUT) &hMidiOut, uiMidiOut,
- (DWORD) hwnd, 0L, CALLBACK_WINDOW );
-
- Here, uiMidiOut has been initialized to a valid MIDI device ID -
- this I checked. The hwnd is just a window handle -- I don't
- think it makes any difference even if it is actually a dialog:
- a window is a window, right? So I could direct the MIDI messages
- to a scrollbar if I felt like it. ;-)
-
- Anyway, what happens is that when I compile this stuff with
- WIN31 and STRICT, the midiOutOpen() call bombs, giving me
- an Error 11: Invalid parameter passed to a system function.
- The funny thing is that when I compile it _without_ STRICT,
- the call works OK.
-
- So what's the invalid parameter? The obvious workaround is
- to compile without STRICT, but then you lose many other
- nice checks for stupid errors.
-
- Jere
- --
- /* Jere K{pyaho -- jere@kielo.uta.fi -- University of Tampere, Finland */
- /* Department of Translation Studies -- Department of Computer Science */
-