Memory allocation with new

Hi,
I am writing an application using Win32 api and using vc++ 6.0 under WinXp sp2.. I need to dynamically allocate a 9MB of space to store some .bmp image. I tried doing it with the 'new' operator but it seems to be failing since i m not getting the data. The space need to return me LPBYTE pointer.. can anybody suggest me an alternative to new operator and how can i ascertain that new is failing since its not giving me any exception!

thanks
regards
[482 byte] By [Pravish] at [2007-11-20 10:52:13]
# 1 Re: Memory allocation with new
Are you sure that new fails? 9Mb isn't that much so the risk of a failure seems minimal. Create a small compileable code snippet that reproduces the error and post it here, most likely it is someting else than an allocation failure.
S_M_A at 2007-11-9 13:32:24 >
# 2 Re: Memory allocation with new
I had same problem few months back, so I started using windows specific memory allocation functions and they worked perfect for me.

See help for GlobalAlloc, GlobalFree.

Besides, you can use memory mapped files to read faster than ever.

regards
Ali Imran at 2007-11-9 13:33:23 >