www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/05/01:19:09

From: Weiqi Gao <weiqigao AT a DOT crl DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Question about RSXNTDJ v 1.3 - hellowin.zip (0/1)
Date: Fri, 04 Jul 1997 19:29:46 -0500
Organization: Spectrum Healthcare Services
Lines: 43
Message-ID: <33BD957A.646D5BCC@a.crl.com>
References: <33bc7a41 DOT 34121017 AT 207 DOT 172 DOT 3 DOT 53>
NNTP-Posting-Host: a116009.stl1.as.crl.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019