BEGIN expected in dialog

Posted by Kerwen Blog on June 3, 2015

最近在做Win32程序向WinCE平台迁移的工作,debug时发现很多问题,下面是其中之一,还好找到了解决方法

原文地址:http://qscribble.blogspot.hk/2013/07/begin-expected-in-dialog.html
When you have a resource file used by both a Win32 project and a WinCE project, and if you edit the resource file using the Win32 resource editor in Visual Studio, you will get errors like this when the WinCE resource compiler tries to compile it:

.\Resource.rc(112) : error RC2112 : BEGIN expected in dialog
.\Resource.rc(112) : error RC2135 : file not found: 0x1
.\Resource.rc(114) : error RC2135 : file not found: …
.\Resource.rc(116) : error RC2135 : file not found: PUSHBUTTON
.\Resource.rc(119) : error RC2135 : file not found: CONTROL

The error occurs on a “FONT” line like this:


STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
FONT 8, “MS Shell Dlg”, 0, 0, 0x1
BEGIN

To fix the error, simply remove the last three parameters:

STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
FONT 8, “MS Shell Dlg”
BEGIN

Fixed!