MFC Question

This is a discussion on MFC Question within the Windows Programming forums, part of the Platform Specific Boards category; Ok, I searched MSDN for a while, and couldn't get an answer, and here's my question: Why is it that ...

  1. #1
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644

    MFC Question

    Ok, I searched MSDN for a while, and couldn't get an answer, and here's my question:

    Why is it that everytime I compile a MFC project (with nothing changed), I get this error:
    Code:
    C:\Program Files\Microsoft Visual Studio\MyProjects\MFC_Test\MFC_Test.rc(11) : fatal error RC1015: cannot open include file 'afxres.h'.
    I could compile MFC programs before I re-installed VC++ 6.

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    26
    Oddly enough, VC++ adds afxres.h to resource files even when you aren't using an MFC project, and yet the file may only be installed if you install MFC. This perticular file isn't actually required, so to fix the error you can edit the .rc file in notepad and replace both occurances of "afxres.h" with "winres.h" (note that there should be two of them, and you need to change both).

  3. #3
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Originally posted by jkw2068
    Oddly enough, VC++ adds afxres.h to resource files even when you aren't using an MFC project, and yet the file may only be installed if you install MFC. This perticular file isn't actually required, so to fix the error you can edit the .rc file in notepad and replace both occurances of "afxres.h" with "winres.h" (note that there should be two of them, and you need to change both).
    I fixed it by re-installing the MFC Libraries and such (just be on the safe side).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MFC check box question
    By MyglyMP2 in forum Windows Programming
    Replies: 2
    Last Post: 03-09-2009, 06:47 PM
  2. MFC simple question
    By dole.doug in forum Windows Programming
    Replies: 5
    Last Post: 09-26-2008, 07:11 AM
  3. Window Resize question (MFC)
    By IfYouSaySo in forum Windows Programming
    Replies: 2
    Last Post: 11-16-2005, 12:34 PM
  4. MFC UI question
    By naruto in forum Windows Programming
    Replies: 1
    Last Post: 04-21-2005, 11:10 PM
  5. MFC Dialog App Screen Refresh Question
    By Scotth10 in forum Windows Programming
    Replies: 2
    Last Post: 10-18-2002, 03:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21