Hello,

I have a legacy app at work that is failing intermittently in a call to
CreateCompatibleBitmap:

HDC hdc = GetDC(0);
HBITMAP hbm = CreateCompatibleBitmap( hdc, w, h );
// w * h = 13,591,552

GetLastError() returned 8.
Error message: Not enough storage is available to process this command.

I have 123 GB free on my HDD and I'm running XP with 2 GB of RAM, with over
1 GB available at failure.

The app has approx. 280 GDI objects and 70 USER objects for each instance.
The limit for GDI objects is 10,000 per process. 280 doesn't seem like a
lot; two instances of Internet Explorer have 932 user and 1600 GDI objects
between them. Total for all GDI objects in the system during an app failure
was about 4600.

Can anyone shed some light on this error?

Thank you.
Jim Brown

Re: Not enough storage is available to process this command? by Igor

Igor
Thu May 24 17:17:45 CDT 2007

Jim Brown <noSpam@nowhere.net> wrote:
> I have a legacy app at work that is failing intermittently in a call
> to CreateCompatibleBitmap:
>
> HDC hdc = GetDC(0);
> HBITMAP hbm = CreateCompatibleBitmap( hdc, w, h );
> // w * h = 13,591,552
>
> GetLastError() returned 8.
> Error message: Not enough storage is available to process this
> command.

http://groups.google.com/group/microsoft.public.win32.programmer.gdi/browse_frm/thread/59a5dd42aaa5bb7c
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



Re: Not enough storage is available to process this command? by Ivan

Ivan
Fri May 25 12:18:57 CDT 2007

Some correction to that link:

Device Compatible Bitmaps are created by
the current display driver, if the driver supports them.

The display driver may allocate them out of video memory,
and charge the session space only for a limited mapped view.

The most common implementation I've seen does map
a whole chunck of video memory in session space, so,
session-view space is the resource you compete against.

Other (display driver) implementations may choose to
charge session pool, system paged pool or system non-paged pool.

In a TS Session, the space availabe for all device compatible bitmap
in a session is limited by connection-negotiate parameters with the
TS-Client.

--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:Ojh$bFlnHHA.4896@TK2MSFTNGP02.phx.gbl...
> Jim Brown <noSpam@nowhere.net> wrote:
>> I have a legacy app at work that is failing intermittently in a call
>> to CreateCompatibleBitmap:
>>
>> HDC hdc = GetDC(0);
>> HBITMAP hbm = CreateCompatibleBitmap( hdc, w, h );
>> // w * h = 13,591,552
>>
>> GetLastError() returned 8.
>> Error message: Not enough storage is available to process this
>> command.
>
> http://groups.google.com/group/microsoft.public.win32.programmer.gdi/browse_frm/thread/59a5dd42aaa5bb7c
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>