afxres.h and RC Files RRS feed

  • Question

  • Hello,

    I downloaded the DirectX SDK and created an .rc file with the GDF Editor.

    I downloaded Windows SDK and used its RC executable in order to complile the .rc file into a .res file.

    I get an error telling me that afxres.h cannot be found. Now, I have the Windows SDK and Visual C++ 2008 installed on my machine.. shouldn't one of them include the afxres.h header file? If not, where do I get it, or how do I make sure the RC compiler "sees it"?

    I checked out an old topic in the MSDN forums back in times where Windows SDK was known as PSDK, and it said that the /include/ directory has a /mfc/ directory with afxres.h in it. But my installation of Windows SDK does not include such directory in the INCLUDE folder. According to wikipedia, MFC (which supposedly includes afxres.h) comes with Visual Studio, but I have Visual c++, C#, and VB.Net installed on my machine and it still says afxres.h cannot be found.

    Am I missing something?
    Sunday, January 13, 2008 1:39 PM

All replies

  • No.. noone? Sad

    Well, I hope this helps.. but the SDK I downloaded was the Windows Vista SDK here [http://www.microsoft.com/downloads/details.aspx?familyid=FF6467E6-5BBA-4BF5-B562-9199BE864D29].
    Monday, January 14, 2008 11:41 AM
  • Hi,


    What is your Visual C++ edition?


    "afxres.h” is a part of MFC; Visual C++ express edition doesn’t support MFC by default.


    Friday, January 18, 2008 2:38 AM
  • Hey,
    Sorry for the late reply.. ANYWAYS, my Visual C++ version is 2008 (VC++ v9).

    Yeah, I do know that afxres.h is part of MFC but I don't know where to obtain it.. I thought it was part of the Windows SDK but even after installing that I didn't get afxres.h.
    Wednesday, January 23, 2008 11:04 AM
  • I tried this and it worked:


    Search your computer for any old afxres.h and use that.

    It worked for me!

    Heres where mine was...

    #include "C:\VisualStudio-Microsoft SDKs\Windows\v6.1\Samples\winui\TSF\tsfapp\afxres.h"



    Wednesday, October 15, 2008 7:31 PM
  • Just add this to the .RC file and comment out the include for afxres.h:

    //#include "afxres.h"






    IDC_STATIC (-1)

    Tuesday, January 5, 2010 9:13 PM
  • Hello!
    You can get a trial of Visual Studio 2008 or 2010 I suppose.

    If not, try to write your resource file manually and see if it works. Try this tutorial:


    You can also open with notepad the .RC file that you've created earlier and copy-paste the text into your resource file, in visual c++ express, in your project. It will be automatically compiled, even if you can't see the actual dialog, like in a resource editor, because the express edition does not have that.

    Then, don't forget to include the "yourResource.h" in the .RC file and in your source files. Follow that tutorial.

    Wednesday, January 6, 2010 6:27 PM