Microsoft KB Archive/65180

Discardable Bitmap Resources > 64K RIP in Enhanced Mode

PSS ID Number: Q65180 Article last modified on 11-05-1993

3.00 MS-DOS

= SUMMARY =

Applications with bitmap resources greater than 64K will cause the application to generate the diagnostic message 0x0280 “Invalid global handle” while running Windows in 386 enhanced mode.

= MORE INFORMATION =

If a large bitmap is marked as DISCARDABLE in the resource file and is subsequently loaded in the application, it is discarded shortly after it is locked. This causes a problem when an attempt is made to free the resource. The global handle referring to the bitmap is invalid and a RIP occurs. This problem is encountered when using the Windows API resource functions such as FindResource, LoadResource, LockResource, and FreeResource. It also occurs with LoadBitmap because this function uses the resource functions. Please note that this problem only occurs in Windows 386 enhanced mode. To work around this problem, remove the DISCARDABLE flag from the bitmap in the resource file. As an alternative, you can remove the bitmap from the executable file and process it as an external bitmap file.

KBCategory: KBSubcategory: GdiBmpInres Copyright Microsoft Corporation 1993.