Subject: Petzold and Mingw32 (Was: Re: MS Platform SDK)
From: [email-masked] (Colin Peters)

27 Nov 1997 05:04:21 -0800
Message-ID: <[email-masked]>
Reply-To: "Colin Peters" <[email-masked]>
Mime-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_0047_01BCFB19.A1276900"
To: <[email-masked]>,
        "Joshua J Little" <[email-masked]>
Cc: <[email-masked]>

This is a multi-part message in MIME format.

------=_NextPart_000_0047_01BCFB19.A1276900
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

From: Paul Garceau <[email-masked]>
Date: Thursday, November 27, 1997 4:42 AM
>>  I would really like
>> to be able to get the SDK to work, so I'd appreciate any help you can
>> give.  (My main reason is that I am trying to get the programs given in
>> "Programming Windows 95" by Charles Petzold to compile with a free
>> compiler.)  Any help/advice you can give me would be greatly
appreciated.
>
> Most of those "should" compile with either Cygwin32 or mingw32 as long
>as the headers are set up properly and there are no references to APIs
>such as the MS DirectX.
>
> Any MS APIs that might exist such as DirectX 4 or later do not have
>any corresponding headers pre-defined for their respective DX APIs.  The
>available Win32 headers for mingw32 (Minimalist GNU-C/C++) can compile
any
>Win32 based programs that you might have, including DX3.

While I'm happy to hear that Mingw32 works so well :-) there is at least
one point where the definitions and such for an example from the Petzold
book won't work with the GNU version of the Win32 API files (it will work
with the Platform SDK files if you get them to compile). The first example
("Hello Windows 95!") uses some mmsystem.h definitions which haven't made
it into the API files yet. I posted a short mmsystem.h file some time ago
on this list which is enough to get this working. It's short, so here it
is again... as an attachment.

You might also want to note that many examples that use resource files
will not compile out of the box with rcl. Try rc.exe from the MS Platform
SDK if you can, or modify the resource files to always use BEGIN and END
instead of { and }, plus don't use any accelerators and don't expect
dialog boxes to work :-(

Colin.

P.S. I have used the new integrated (includes res2coff like capability)
windres from Mumit Khan's EGCS package, but it seems to (1) GPF on
accelerator tables (at least RCL only gave syntax errors) and (2) work
even worse on dialog boxes.

P.P.S There seems to be a bug in res2coff that makes dialog boxes not work
very well in any case (even with MS rc.exe). I'm working on it.

-- Colin Peters -- colin at fu.is.saga-u.ac.jp
-- Saga University Dept. of Information Science
-- http://www.fu.is.saga-u.ac.jp/~colin
-- http://www.geocities.com/Tokyo/Towers/6162

------=_NextPart_000_0047_01BCFB19.A1276900
Content-Type: application/octet-stream;
	name="mmsystem.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="mmsystem.h"

//
// Temporary mmsystem.h because GNU-Win32 doesn't have one yet.
//
// This code is in the PUBLIC DOMAIN and has NO WARRANTY.
//
// Original Author: Colin Peters <[email-masked]>
//
// $Revision: 1.1 $
// $Author: colin $
// $Date: 1997/10/04 01:25:04 $
//

#ifndef _MMSYSTEM_H_
#define _MMSYSTEM_H_

#ifdef	__cplusplus
extern "C" {
#endif

/* Flags for PlaySound */
#define SND_SYNC		0x00000000
#define	SND_ASYNC		0x00000001
#define	SND_NODEFAULT		0x00000002
#define	SND_MEMORY		0x00000004
#define	SND_LOOP		0x00000008
#define SND_NOSTOP		0x00000010
#define SND_PURGE		0x00000040
#define SND_APPLICATION		0x00000080
#define SND_NOWAIT		0x00002000
#define	SND_ALIAS		0x00010000
#define	SND_FILENAME		0x00020000
#define	SND_RESOURCE		0x00040004
#define	SND_ALIAS_ID		0x00110000

BOOL WINAPI PlaySoundA (LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
BOOL WINAPI PlaySoundW (LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound);

#ifdef	UNICODE
#define	PlaySound	PlaySoundW
#else
#define PlaySound	PlaySoundA
#endif

#ifdef __cplusplus
}
#endif

#endif /* Not defined _MMSYSTEM_H_ */

------=_NextPart_000_0047_01BCFB19.A1276900--

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".