Mail Archives: djgpp/1997/07/05/01:19:09
Dave Loose wrote:
>
> I downloaded rsxntdj and the book _Programming Windows 95_ by Charles
> Petzold was recommended to me.
>
> I bought the book, but when I got it home and tried to compile its
> examples, rsxntdj gave me all kinds of errors. I set the environment
> variable correctly. I know because I can compile the samples that came
> with rsx.
>
> [These are the errors in the error.txt file attached to the article]
> hellowin.c: In function `WndProc':
> hellowin.c:65: `SND_FILENAME' undeclared (first use this function)
> hellowin.c:65: (Each undeclared identifier is reported only once
> hellowin.c:65: for each function it appears in.)
> hellowin.c:65: `SND_ASYNC' undeclared (first use this function)
>
> [These is the offending line of code]
> PlaySound ("hellowin.wav", NULL, SND_FILENAME | SND_ASYNC) ;
>
> What modifications need to be made to the code from the book so that
> it will work with rsxntdj?
>
> I have included a sample program from the book and the errors that I
> got when I compiled it.
Short answer: delete the offending line of code, and everything will
work fine.
Long answer: the function PlaySound() resides in a dll called
MMSYSTEM.DLL. To link this function into your program, you need an
import library (*.LIB in Visual C++ or lib*.a for RSXNTDJ 1.3.1). As
far as I can see, such an import library is not supplied with RSXNTDJ
1.3.1. RSXNTDJ 1.3.1 does include a tool makelib which makes the import
library from the dll, however it doesn't work for MMSYSTEM.DLL,
complaining that it is "not a valid Win32 file". Upon close inspection,
we find that MMSYSTEM.DLL is a 16-bit dll in the NE (Win31) format. And
frankly, I don't know if I will ever be able to figure out how to use it
with DJGPP 2.01/RSXNTDJ 1.3.1 (gcc being 32-bit only and all...).
--
Weiqi Gao
weiqigao AT a DOT crl DOT com
- Raw text -