FIX: RC1015 Error When Using Resource View If the Include Path is Too Long (326987)



The information in this article applies to:

  • Microsoft Visual C++ .NET (2002)

This article was previously published under Q326987

SYMPTOMS

In the Resource View window, when you expand the tree view of the project resources, you receive the following Microsoft Visual Studio error message:
fatal error RC1015: cannot open include file 'afxres.h'

CAUSE

This problem can be caused by an excessively long Include files directory path (over 512 bytes).

RESOLUTION

Although you can still build the project, you cannot use the WYSIWIG resource editors to modify the .rc file.

To resolve this problem, remove some of the Include paths:
  1. On the Tools menu, click Options.
  2. In the left pane of the Options dialog box, click the Projects folder, and then click VC++ Directories.
  3. In the Show directories for list, click Include files.
  4. In the lower window, delete some of the paths, and then click OK.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Microsoft Visual C++ .NET (2003).

MORE INFORMATION

Steps to Reproduce the Behavior

  1. On the Tools menu, click Options.
  2. In the left pane of the Options dialog box, click the Projects folder, and then click VC++ Directories.
  3. In the Show directories for list, click Include files.
  4. Copy the longest directory that is listed in the lower window, and then paste it multiple times so that your Visual C++ Include path is longer.
  5. Create a new project that contains Windows resources.

    Alternatively, delete the .aps file from an existing project, open the project, and then try to expand the resources tree in the Resource View window.

    IMPORTANT: You must delete the .aps file if it has already been generated. If the project is already open, the .aps file is locked. Therefore, you must close the project and then delete the file.
The error occurs.

Modification Type:MajorLast Reviewed:4/11/2003
Keywords:kbfix kbbug kbpending KB326987