PRB: Cannot Load Module with Resource ID > 32767 (0x7FFF)

Last reviewed: February 9, 1998
Article ID: Q137248
4.00 WINDOWS bui

The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows 95 version 4.0
    

SYMPTOMS

The GetLastError() function returns error 11 ("An attempt was made to load a program with an incorrect format."), and the LoadLibrary(), WinExec() or CreateProcess() function fails if the module you are trying to load contains a resource identifier (ID) that is greater than 32767 (0x7FFF).

CAUSE

Microsoft Windows 95 uses the high bit in the 16-bit resource ID to determine if the resource ID is a numeric value or a string. When this bit is set, the operating system determines that the ID is a string. Therefore, it appears that the file is corrupted.

RESOLUTION

All applications must ensure that all of the resource IDs in their modules are less than 0x7FFF. These are resource IDs only (DIALOG, MENU, ICON, CURSOR, STRINGTABLE, BITMAP, ACCELERATOR, FONT, and so on); control and menu IDs are not included in this restriction.


Additional reference words: 1.30 4.00
KBCategory: kbui
KBSubcategory: UsrCtl W32s


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 9, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.