Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. afxres.h and resource file issues

afxres.h and resource file issues

Scheduled Pinned Locked Moved Mobile
c++helpvisual-studiojsonquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rodent
    wrote on last edited by
    #1

    using evc++ 3.0 on win2k system and having the following issue. i'm building a simple ppc2k2 win32 api based app (no mfc or atl) and the ide isn't creating any files for me. i create an icon resource using "include->resource...", draw the icon, name the .rc file same name as my project file, save the .rc file in the same directory as my .cpp file, and then using "project->add to project->files" add the .rc and resource.h files to my project. first problem is afxres.h can't be found (doesn't exist on my system) and ide can't open up the resources..i remove the #include "afxres.h" from the .rc file. then trying to access the .rc file from the ide gives two errors (RC2144: PRIMARY LANGUAGE ID not a number, RC2135: file not found: 101) and fails to load resources again. finally i edit the .rc file and remove the following and the ide seems ok with the .rc file.

    ///////////////////////////////////////////
    // English (U.S.) resources

    #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
    #ifdef _WIN32
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    #pragma code_page(1252)
    #endif //_WIN32

    i'd like to have the .rc files and editor work without requiring mods every time...what am i doing wrong and what's the purpose of afxres.h? thanks...

    S 1 Reply Last reply
    0
    • R rodent

      using evc++ 3.0 on win2k system and having the following issue. i'm building a simple ppc2k2 win32 api based app (no mfc or atl) and the ide isn't creating any files for me. i create an icon resource using "include->resource...", draw the icon, name the .rc file same name as my project file, save the .rc file in the same directory as my .cpp file, and then using "project->add to project->files" add the .rc and resource.h files to my project. first problem is afxres.h can't be found (doesn't exist on my system) and ide can't open up the resources..i remove the #include "afxres.h" from the .rc file. then trying to access the .rc file from the ide gives two errors (RC2144: PRIMARY LANGUAGE ID not a number, RC2135: file not found: 101) and fails to load resources again. finally i edit the .rc file and remove the following and the ide seems ok with the .rc file.

      ///////////////////////////////////////////
      // English (U.S.) resources

      #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
      #ifdef _WIN32
      LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
      #pragma code_page(1252)
      #endif //_WIN32

      i'd like to have the .rc files and editor work without requiring mods every time...what am i doing wrong and what's the purpose of afxres.h? thanks...

      S Offline
      S Offline
      Steve S
      wrote on last edited by
      #2

      2. afxres.h This is an MFC supplied file which defines resource IDs for stuff like strings for use in menu hinting etc. You should be able to remove the reference to it from the "View/Resource Includes" option. I suspect that it (afxres.h)will be including other files which define LANG_ENGLISH. On my system here, that's WINNT.H, your system may be different. Once you've identified it, you could try using "View/Resource Includes" to specify that file should be included. That way you should not need to make any other changes manually. Steve S I am not an embedded/mobile expert

      R 1 Reply Last reply
      0
      • S Steve S

        2. afxres.h This is an MFC supplied file which defines resource IDs for stuff like strings for use in menu hinting etc. You should be able to remove the reference to it from the "View/Resource Includes" option. I suspect that it (afxres.h)will be including other files which define LANG_ENGLISH. On my system here, that's WINNT.H, your system may be different. Once you've identified it, you could try using "View/Resource Includes" to specify that file should be included. That way you should not need to make any other changes manually. Steve S I am not an embedded/mobile expert

        R Offline
        R Offline
        rodent
        wrote on last edited by
        #3

        thanks Steve and it makes sense...i'll check out WINNT.H on my system for the #defines you mention. what's frustrating me is that i haven't found out why the resource compiler is even including afxres.h in the resource includes when i purposely create the project as a non-MFC project and don't utilize the wizard-created files. i'll check out what you suggest as well as continue to dig into the compiler/linker/other options in hope of finding this.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups