Not enough storage is available to process this command.

Not enough storage is available to process this command.

Post by nandan.meh » Sat, 02 Dec 2006 18:46:32


Hi,


I am getting this error message at the time of debuging means
GetlastError() returns 8.
I m going to create new imagelist. here is my code snippet.........

HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 , 0, 0);

int j = GetLastError();
here value of j is 8.

Plz tell me what should i do.

Nadan
 
 
 

Not enough storage is available to process this command.

Post by Scott McPh » Sat, 02 Dec 2006 22:25:59


Call GetLastError() only if ImageList_Create() returns NULL.

--
Scott McPhillips [VC++ MVP]

 
 
 

Not enough storage is available to process this command.

Post by Tom Serfac » Sun, 03 Dec 2006 00:28:19

Hi Nandan,

The problem has already been identified (you put 0 for size and 0 for
growth). I typically put the number of initial items in (if I know it) and
grow by 1. Since my image lists are not typically big the grow parameter
doesn't really slow it down much.

So if I knew I had 4 bitmaps to store in the image list I would put 4,1 even
if I didn't plan to put any more in. No harm, no foul.

Tom
 
 
 

Not enough storage is available to process this command.

Post by nandan.meh » Sun, 03 Dec 2006 00:58:45

Hi,

I am getting this error message at the time of debuging means
GetlastError() returns 8.
I m going to create new imagelist. here is my code snippet.........

HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 , 8,1);


in last two parameter i have give all the thing still it is giving the
same error
int j = GetLastError();
here value of j is 8.

Plz tell me what should i do.

Nadan
 
 
 

Not enough storage is available to process this command.

Post by Joseph M. » Sun, 03 Dec 2006 04:18:05

See below...


****
Why do you think GetLastError() has any meaning here? GetLastError is, with a few rare
exceptions, defined ONLY if the last API failed. If it succeeded, GetLastError has no
meaning. So unless you check the value of hList and see it is NULL, then you have no idea
whether or not ::GetLastError has any meaning.
joe
*****
Joseph M. Newcomer [MVP]
email: XXXX@XXXXX.COM
Web: http://www.yqcomputer.com/
MVP Tips: http://www.yqcomputer.com/