When editing a rc file, then opening it in VC Dialog Wizard, I get error RC2104 because of TBS_NOTIFYBEFOREMOVE

≯℡__Kan透↙ 提交于 2021-01-28 06:08:57

问题


I have a VC++/MFC dialog-based project. In those dialogs, I'm using some sliders with "Notify Before Move" at true. Sometimes, instead of using VS dialog wizard to edit them, I prefer to edit the related .rc file manually in a text editor.

The issue is, after editing the .rc file, when I'm trying to open a dialog in VS wizard again, I get this error: "error RC2104: undefined keyword or key name: TBS_NOTIFYBEFOREMOVE" I can still compile the project successfully, but I cannot open the project resources with VS wizard anymore. The workaround is to remove manually the keyword, then I can re-open resources with the wizard, but I have to set every slider "Notify Before Move" setting at true again...

I don't understand why I get this error despite the project still compiling fine. If possible, I want to avoid the error and having to go through this workaround each time. Does anybody know how to avoid this error?


回答1:


This happens because of the value for the _WIN32_WINNT macro you selected. The TBS_NOTIFYBEFOREMOVE style flag is only available in later versions of Windows. You must select at least 0x501. Or in other words, your program won't be able to run on Windows 2000 (version 0x500) or earlier. That's not much of a problem these days so bump up the value.




回答2:


I add

#include <windows.h>

in the Resource.h, and solved it!



来源:https://stackoverflow.com/questions/10349841/when-editing-a-rc-file-then-opening-it-in-vc-dialog-wizard-i-get-error-rc2104

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!