Microsoft KB Archive/170530: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
(2 intermediate revisions by the same user not shown)
Line 54: Line 54:
<div class="errormessage">
<div class="errormessage">


&lt;project\project.rc&gt;(118) : fatal error RC1015: cannot open include file<br />
<project\project.rc>(118) : fatal error RC1015: cannot open include file<br />
'res\\XXXXXXX.rc2'.
'res\\XXXXXXX.rc2'.


Line 76: Line 76:


* Replace all references to code_page(1252) with the proper code_page.
* Replace all references to code_page(1252) with the proper code_page.
* Replace all references to &quot;Language 9,1&quot; with the proper language, sub-language code pair.
* Replace all references to "Language 9,1" with the proper language, sub-language code pair.


There are three places in a typical .rc file to change these values:<br />
There are three places in a typical .rc file to change these values:<br />
Line 85: Line 85:
<pre class="codesample">      3 TEXTINCLUDE DISCARDABLE
<pre class="codesample">      3 TEXTINCLUDE DISCARDABLE
       BEGIN
       BEGIN
           &quot;#define _AFX_NO_SPLITTER_RESOURCES\r\n&quot;
           "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
           &quot;#define _AFX_NO_OLE_RESOURCES\r\n&quot;
           "#define _AFX_NO_OLE_RESOURCES\r\n"
           &quot;#define _AFX_NO_TRACKER_RESOURCES\r\n&quot;
           "#define _AFX_NO_TRACKER_RESOURCES\r\n"
           &quot;#define _AFX_NO_PROPERTY_RESOURCES\r\n&quot;
           "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
         &quot;\r\n&quot;
         "\r\n"
         &quot;#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n&quot;
         "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
         &quot;#ifdef _WIN32\r\n&quot;
         "#ifdef _WIN32\r\n"
         &quot;LANGUAGE 9, 1\r\n&quot;
         "LANGUAGE 9, 1\r\n"
         &quot;#pragma code_page(1252)\r\n&quot;
         "#pragma code_page(1252)\r\n"
         &quot;#endif\r\n&quot;
         "#endif\r\n"
         &quot;#include &quot;&quot;res\\appwizdll.rc2&quot;&quot; // Non-Microsoft Visual C++
         "#include ""res\\appwizdll.rc2"" // Non-Microsoft Visual C++
                                           // edited.
                                           // edited.
               &quot;\r\n&quot;
               "\r\n"
         &quot;#include &quot;&quot;afxres.rc&quot;&quot;   // Standard components\r\n&quot;
         "#include ""afxres.rc""   // Standard components\r\n"
         &quot;#endif&quot;
         "#endif"
           &quot;\0&quot;
           "\0"
       END
       END
                         </pre></li>
                         </pre></li>
Line 116: Line 116:
       #pragma code_page(1252)
       #pragma code_page(1252)
       #endif
       #endif
       #include &quot;res\\appwizdll.rc2&quot; // Non-Microsoft Visual C++ edited
       #include "res\\appwizdll.rc2" // Non-Microsoft Visual C++ edited
                                     // resources.
                                     // resources.
       #include &quot;afxres.rc&quot;   // Standard components
       #include "afxres.rc"   // Standard components
       #endif
       #endif
                         </pre></li></ol>
                         </pre></li></ol>


To make these changes, open the project's .rc file clicking Open on the File menu and selecting Open As type of &quot;Text&quot; instead of &quot;Auto.&quot; Visual C++ will close the resource editor if it is open for this project.
To make these changes, open the project's .rc file clicking Open on the File menu and selecting Open As type of "Text" instead of "Auto." Visual C++ will close the resource editor if it is open for this project.


</div>
</div>

Latest revision as of 10:05, 21 July 2020

Knowledge Base


FIX: AppWizard Project Cannot Open Include File .rc2

Article ID: 170530

Article Last Modified on 11/18/2003



APPLIES TO

  • The AppWizard, when used with:
    • Microsoft Visual C++ 5.0 Enterprise Edition
    • Microsoft Visual C++ 5.0 Professional Edition



This article was previously published under Q170530

SYMPTOMS

When you build an AppWizard-generated project, the resource compiler reports the following error if the default code page is anything other than 1252 (for example, you have an Eastern European or Asian system locale):

<project\project.rc>(118) : fatal error RC1015: cannot open include file
'res\\XXXXXXX.rc2'.

This error only occurs when the project name contains characters greater than 0x7F hex.

CAUSE

The Resource Script for the project that AppWizard generates is hard-coded to specify the code page as 1252 and the language as US English. When the Resource Compiler attempts to load an .rc2 file with a name that has characters greater than 0x7F hex, but the code page 1252 has been specified, the Resource Compiler will not be able to open the .rc2 file.

RESOLUTION

To work around this problem, do the following in the project's .rc file:

  • Replace all references to code_page(1252) with the proper code_page.
  • Replace all references to "Language 9,1" with the proper language, sub-language code pair.

There are three places in a typical .rc file to change these values:

  1. In the TEXTINCLUDE section, TEXTINCLUDE 3 has a reference to the code_page and Language:

          3 TEXTINCLUDE DISCARDABLE
          BEGIN
              "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
              "#define _AFX_NO_OLE_RESOURCES\r\n"
              "#define _AFX_NO_TRACKER_RESOURCES\r\n"
              "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
             "\r\n"
             "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
             "#ifdef _WIN32\r\n"
             "LANGUAGE 9, 1\r\n"
             "#pragma code_page(1252)\r\n"
             "#endif\r\n"
             "#include ""res\\appwizdll.rc2"" // Non-Microsoft Visual C++
                                              // edited.
                  "\r\n"
             "#include ""afxres.rc""    // Standard components\r\n"
             "#endif"
              "\0"
          END
                            
  2. Immediately after the TEXTINCLUDE section, a set of preprocessor definitions has a reference to the code_page and Language:

          #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
          #ifdef _WIN32
          LANGUAGE 9, 1
          #pragma code_page(1252)
          #endif
                            
  3. At the end of the .rc file, there is a last set of preprocessor definitions with a reference to the code_page and Language:

          #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
          #ifdef _WIN32
          LANGUAGE 9, 1
          #pragma code_page(1252)
          #endif
          #include "res\\appwizdll.rc2"  // Non-Microsoft Visual C++ edited
                                         // resources.
          #include "afxres.rc"    // Standard components
          #endif
                            

To make these changes, open the project's .rc file clicking Open on the File menu and selecting Open As type of "Text" instead of "Auto." Visual C++ will close the resource editor if it is open for this project.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Visual C++, version 6.0.


Keywords: kberrmsg kbbug kbfix kbnoupdate kbvc600fix kbwizard kbcode KB170530