Windres doesn't provide very sensible error messages, this bothers me so
I've been looking into it.

I have two questions.

1. From the documentation I see on MSDN, the snippet below doesn't
  appear to be valid. The LTEXT line ends with a comma, which indicates
  that a style should follow. But it doesn't.

  Look at http://msdn2.microsoft.com/en-us/library/aa381021.aspx for
  a description, the syntax is :
        LTEXT text, id, x, y, width, height [[, style
                 [[, extended-style]]]]

  Effectively, the arm-wince-cegcc-windres fails to compile this line,
  but it accepts it when the comma at the end of the line is removed.

  Question : this is based on one of the examples in the Boling book,
  which is from Microsoft Press. Is the example wrong ?

SMSTalk_PPC DIALOG discardable  25, 5, 120,  98
STYLE  WS_OVERLAPPED | WS_VISIBLE | WS_SYSMENU | DS_MODALFRAME 
CAPTION "SMS Talk"
FONT 8, "System"
BEGIN
    LTEXT   "Received Messages",   -1,   4,   4, 128,  10, 
    LISTBOX               IDD_MSGLIST,   4,  14, 128,  48, WS_TABSTOP

END

2. Windres calls the C preprocessor to deal with macros. This is a
   sensible thing to do because they appear to follow the C syntax.

   However, this makes it hard to produce sensible error messages.
   Consider an input such as this :
ID_MENU_SP RCDATA MOVEABLE PURE 
BEGIN
    ID_MENU_SP, 2,
    I_IMAGENONE, IDOK,  TBSTATE_ENABLED, TBSTYLE_BUTTON | 
                                  TBSTYLE_AUTOSIZE, IDS_EXIT, 0, NOMENU,
    I_IMAGENONE, IDPOP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | 
                                  TBSTYLE_AUTOSIZE, IDS_MENU, 0, 0,
END

   The C preprocessor turns it into this :
100 RCDATA MOVEABLE PURE
BEGIN
    100, 2,
    (-2), 1, 4, 0 |
                                  16, 401, 0, NOMENU,
    (-2), 208, 4, 8 |
                                  16, 402, 0, 0,
END

   Error messages will describe stuff in the latter format which is
   unknown and therefore incomprehensible to the programmer. Not good.

   However, the syntax allowed appears to be a manageable subset of
   the C syntax. Would it be a silly idea to implement that limited
   subset in windres so it becomes independent of the C preprocessor
   and can write better error messages ?

   Does anyone have a better idea?

Thanks,

        Danny
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to