Saturday, February 20, 2021

Error RC2104 undefined keyword or key name: WS_MINIMIZEBOX

Error RC2104 undefined keyword or key name: WS_MINIMIZEBOX openglstruct_driver C:\Demo_GLUT\openglstruct_driver\resbackup.rc 2

  1. Resource Compiler Error RC2104
  2. undefined keyword or key name: key

    The specified keyword or key name is not defined.

    This error is often caused by a typo in the resource definition, or in the included header file. It can also be caused by a missing header file.

    To fix the issue, locate the header file that should contain the defined keyword or key name and verify that it is included in your resource file, and that the keyword or key name is spelled correctly. If your project was created with a precompiled header, and you subsequently remove it, make sure that the resource file still includes any required headers.

    To verify the defined keywords and key names in your resource file, in Visual Studio, open the Resource View window—on the menu bar, choose View, Resource View—and then open the shortcut menu for the .rc file and choose Resource Symbols to view the list of defined symbols. To modify the included headers, open the shortcut menu for the .rc file and choose Resource Includes.

    A Solution: If you encounter this message:

    undefined keyword or key name: MFT_STRING

    please open \MCL\MFC\Include\AfxRes.h and add this include directive:

    #include < winresrc.h >

  3. error RC2104: undefined keyword or key name: DS_SETFONT
  4. A Question:I am starting to learn about the Windows API. So I opened up Microsoft Visual C++ and created a new project. I chose Win32 project and it started up. I then clicked build and run before typing anything and I came up with this error:

    error RC2104: undefined keyword or key name: DS_SETFONT....

    The error told me it was in the windows resource file that I cannot edit. I looked on-line and I couldn't find anything on this topic. How would I go about fixing this?

    A Solution: When the solution is generated, it removes #include < windows.h >. Simply adding #include < windows.h > will fix it. In my case, I added it in the *.rc file.

    Another Solution: It probably has something to do with your decision not to use precompiled headers. Normally, the RC file includes the pre-compiled header, named stdafx.h by default. That in turn includes < Windows.h >. If you've disabled pre-compiled headers and deleted stdafx.h, then you're not including the Windows headers in your resource file. However, I would advise against editing the RC file by hand--it's regenerated on demand by the designer.

No comments:

Post a Comment