Cvtres.exe Program Error May Occur When a Large Resource Script Contains Custom Resources

ID: Q230332


The information in this article applies to:
  • Microsoft Windows NT Server version 4.0
  • Microsoft Windows NT Workstation version 4.0
  • Microsoft Visual C++, 32-bit Editions, version 6.0


SYMPTOMS

A large resource script containing many custom resources with string names may receive the following error during linking:

CVTRES.EXE Application Error - The instruction at "0x01002b2b" referenced memory at [address]. The memory could not be "written".


CAUSE

This problem occurs because there is a limited amount of space available during linking for string names for custom resources. A large resource script containing many custom resources with very long string names may exceed the available space and cause the observed linker error.


RESOLUTION

To resolve this problem, obtain the latest service pack for Windows NT 4.0 or the individual software update. For information on obtaining the latest service pack, please go to:

For information on obtaining the individual software update, contact Microsoft Product Support Services. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.asp


WORKAROUND

To work around this problem, use numbers to identify resources instead of strings.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was first corrected in Windows NT 4.0 Service Pack 6.


MORE INFORMATION

The error has to do with the number of characters in a custom resource name. For example:

If you create a custom resource called "MYTYPE" and add resources under this type using Developer Studio, a number is associated with them in the Resource.h file.

If you delete these numbers or created the custom "MYTYPE" resources by hand, the resource compiler thinks that you intended to reference these resources by a string.

The code to load the resource is different based on if they are identified using numbers or strings.

You would use the following line to load a "MYTYPE" type of resource with the numeric ID ID_MYTYPEONE (defined in resource.h)

FindResource(hMod, MAKEINTRESOURCE(ID_MYTYPEONE), "MYTYPE");
You would use the following line to load a "MYTYPE" type of resource with the string ID "MYTYPEONE" (defined in resource.h)
FindResource(hMod, "MYTYPEONE", "MYTYPE");
The problem at hand deals with custom resources that have been identified with strings rather than numbers. If these strings are long and there are a lot of them, the crash may occur if you overrun the space available for their names. Empirical testing has shown that the following formula may be used to determine when the problem may occur.
Total Number of Characters After Which you Crash = 32760 - #Resources
This means that if you have 5,460 resources, the total number of characters that all of those resource names combined take up should not exceed 27,300.

Additional query words: 4.00

Keywords : kbfile kbbug4.00 kbfix4.00
Version : winnt:4.0,6.0
Platform : winnt
Issue type : kbbug


Last Reviewed: October 28, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.