![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Not enough storage is available to process this command ... problemProblems loading a large bit map
In my software I have a need to load a large bit map (70 Mbytes). I use ::LoadImage() to do this and load the bit map onto a Bitmap CStatic on a dialog. After about 10 or 20 times of running my program, I get a failure being reported by ::LoadImage() which is "Not enough storage is available to process this command" If I reboot the computer, then all is well for another 10 or 20 times I run the software. Clearly my software is not freeing up the temporary storage space for the bit map loading, but I am unsure how to resolve this. No memory leakage is being reported in debug mode for Visual C++ studio v6.0, and there appears to be plenty of RAM available each time I run the program, which is then returned to the same value after the program has ended. I am not sure what FreeLocal(p) is trying to do here. I was hoping it was freeing the 70 Mbytes of temp storage. Does anyone know what might be going wrong? For reference this is the code I am using : CPP / C++ / C Code:
|
|||
|
#2
|
|||
|
|||
Re: Not enough storage is available to process this command ... problemMy help files suggest using DeleteObject() to release its associated memory.
|
|
#3
|
|||
|
|||
Re: Not enough storage is available to process this command ... problemThanks for the info.
I think (could be wrong) that DeleteObject() is a member of CDC, but ::LoadImage() is using some local storage that I dont have access to, other than a void pointer (p). p is pointing to that storage space, but I am not sure it is a CDC object. I cast the void pointer p, into MainPictureHandle which is a HBITMAP. Is there something I can do with this? I belive that the CDC MainDisplayPicture is automatically deleted when the window is detroyed. I could be wrong, and may be this is the problem. |
|
#4
|
|||
|
|||
Re: Not enough storage is available to process this command ... problemA further update:
Firstly I was wrong about DeleteObject, I have now used it as CPP / C++ / C Code:
where p is pointing the void memory space allocated by ::LoadImage(); I just hope that DeleteObject() knows how much of "p" to delete. It compiles. It runs. It closes down with out error but time will tell as they say. Thanks for the help, lets see what happens. |
|
#5
|
|||
|
|||
Re: Not enough storage is available to process this command ... problemGiven MSDN suggests destroying with DeleteObject (here), I would assume it's doing what it's supposed to. It's the way malloc and free, new and delete, work. You don't specify the size when you free/delete the memory used, but it knows what to do with it.
|
Recent GIDBlog
Problems with the Navy (Enlisted) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How a child process past a value to parent process? | Reny | Computer Software Forum - Linux | 11 | 09-Apr-2007 08:46 |
| How to return value from child process to parent process | Reny | C Programming Language | 1 | 16-Mar-2007 10:38 |
| Program on creating a process!! | sac_garg | C Programming Language | 3 | 01-Oct-2006 09:22 |
| round robin scheduling using c | eclipt | C Programming Language | 1 | 27-Dec-2005 16:34 |
| [TUTORIAL] Calling an external program in C (Linux) | dsmith | C Programming Language | 4 | 22-Apr-2005 13:30 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The