Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <200001102159.PAA22820@hp2.xraylith.wisc.edu> To: Sascha Ziemann cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: windres and an icon in a dialog In-reply-to: Your message of "10 Jan 2000 22:40:26 +0100." Date: Mon, 10 Jan 2000 15:59:04 -0600 From: Mumit Khan Sascha Ziemann writes: > Hi, > > I am doing my fist W32 programming steps with a mingw32 cross > compiler. I tried an example from Charles Petzold's "Windows > Programming": > > 42 ABOUT_WINDOW DIALOG DISCARDABLE 32, 32, 180, 100 > 43 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION > 44 CAPTION "The caption" > 45 FONT 8, "MS Sans Serif" > 46 BEGIN > 47 DEFPUSHBUTTON "Ok", IDOK, 66, 80, 50, 14 > 48 ICON "ABOUT1", IDC_STATIC, 7, 7, 21, 20 > 49 CTEXT "First text", IDC_STATIC, 40, 12, 100, 8 > 50 CTEXT "Second text", IDC_STATIC, 7, 52, 166, 8 > 51 END > 52 > 53 ABOUT1 ICON DISCARDABLE "an_icon.ico" > > When I try to compile it, I get the following error: > > i386-mingw32msvc-windres: resources.de.rc:49: parse error > > The error message is quite short. Does anybody know what is wrong > with the code? Windres here is following Microsoft's spec[1] for the ICON control statement and correctly rejecting this statement per spec. However, MS RC compiler seems to accept this, and a lot of the books have used this simply because it works (to be correct, it needs a ICON_STYLE parameter in addition to the 4 numbers you have there). I'll fix the incompatibility for the next release, but till then, you can do the following (works for MS compiler as well): ICON "ABOUT1", IDC_STATIC, 7, 7, 21, 20, 0 where the last 0 just "or"s 0 to the list of current styles. FYI, this is equivalent to: ICON "ABOUT1", IDC_STATIC, 7, 7, 21, 20, SS_ICON | WS_CHILD | WS_VISIBLE Regards, Mumit [1] See "windres - Resource-Definition Statements" http://msdn.microsoft.com/library/psdk/winui/rc_35rn.htm -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com