当我们给Dialog添加图片的时候,经常会出现:错误 1 error RC2108: expected numerical dialog constant C:\xx\xxx.rc 57 1 xxx
问题代码:
IDD_DIALOG1 DIALOGEX 0, 0, 385, 240
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL IDB_BG, IDC_STATIC, 0, 0, 173, 215, NOT WS_GROUP
END
只需要在IDB_BG, IDC_STATIC,后面添加"Static", SS_BITMAP即可
修正后的代码:
CONTROL IDB_BG, IDC_STATIC, "Static", SS_BITMAP,0, 0, 173, 215, NOT WS_GROUP