VS2022 Resource Editor Problems

Nikolas Fraser 60 Reputation points
2024-12-29T15:43:34.2766667+00:00

I've been following through the Microsoft Learn documentation for Getting Started with Win32 and C++ but I've run into a lot of problems with the resource editor in Visual Studio 2022. ( https://zcusa.951200.xyz/en-us/windows/win32/learnwin32/accelerator-tables)

It started out saying it was unable to open a file, then it progressed to access denied, now the build just fails stating file not found for things which don't look like they're supposed to be files.

User's image

I also experience a lot of crash to desktops when trying to work with resources in VS.

Is there a way to get this tool to work better, or just disable it altogether?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,702 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 46,286 Reputation points
    2024-12-30T00:37:28.42+00:00

    Try this for your skeleton resource.h and filename.rc -

    resource.h

    //{{NO_DEPENDENCIES}}
    // Microsoft Visual C++ generated include file.
    // Used by filename.rc
    
    // Next default values for new objects
    // 
    #ifdef APSTUDIO_INVOKED
    #ifndef APSTUDIO_READONLY_SYMBOLS
    #define _APS_NEXT_RESOURCE_VALUE        101
    #define _APS_NEXT_COMMAND_VALUE         40001
    #define _APS_NEXT_CONTROL_VALUE         1001
    #define _APS_NEXT_SYMED_VALUE           101
    #endif
    #endif
    

    filename.rc

    // Microsoft Visual C++ generated resource script.
    //
    #include "resource.h"
    
    #define APSTUDIO_READONLY_SYMBOLS
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 2 resource.
    //
    #include "winres.h"
    
    /////////////////////////////////////////////////////////////////////////////
    #undef APSTUDIO_READONLY_SYMBOLS
    
    /////////////////////////////////////////////////////////////////////////////
    // English (United States) resources
    
    #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    
    #ifdef APSTUDIO_INVOKED
    /////////////////////////////////////////////////////////////////////////////
    //
    // TEXTINCLUDE
    //
    
    1 TEXTINCLUDE 
    BEGIN
        "resource.h\0"
    END
    
    2 TEXTINCLUDE 
    BEGIN
        "#include ""winres.h""\r\n"
        "\0"
    END
    
    3 TEXTINCLUDE 
    BEGIN
        "\r\n"
        "\0"
    END
    
    #endif    // APSTUDIO_INVOKED
    
    #endif    // English (United States) resources
    /////////////////////////////////////////////////////////////////////////////
    
    
    
    #ifndef APSTUDIO_INVOKED
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 3 resource.
    //
    
    
    /////////////////////////////////////////////////////////////////////////////
    #endif    // not APSTUDIO_INVOKED
    
    

    Note that the .rc file you posted omitted the content from TEXTINCLUDE2


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.