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

ID: Q137248


The information in this article applies to:


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 and Windows 98 use 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.


Keywords          : kbResource kbGrpUser kbWinOS95 kbWinOS98 
Version           : 
Platform          : 
Issue type        : kbprb 

Last Reviewed: March 5, 1999