GlobalRealloc big problem ....
-
hello, I have a code that raise this error "Not enough storage is available to process this command." when I try to Realloc a buffer .... temp = (DWORD)GlobalReAlloc((HGLOBAL)eyeConClients[msg - SOCKET_ID - 1].buffer, szTemp, GMEM_MOVEABLE); this works ok many times ... and randomly raise that error .... any suggestions ? please help .... thanks !!!
-
hello, I have a code that raise this error "Not enough storage is available to process this command." when I try to Realloc a buffer .... temp = (DWORD)GlobalReAlloc((HGLOBAL)eyeConClients[msg - SOCKET_ID - 1].buffer, szTemp, GMEM_MOVEABLE); this works ok many times ... and randomly raise that error .... any suggestions ? please help .... thanks !!!
GlobalRealloc()
does not necessarily return the same memory handle as the one passed to it - it's value may change. You need to store the new value:eyeConClients[msg - SOCKET_ID - 1].buffer = GlobalReAlloc((HGLOBAL)eyeConClients[msg - SOCKET_ID - 1].buffer, szTemp, GMEM_MOVEABLE);
If you need to cast your buffer to a HGLOBAL, you will need to cast the return value of
GlobalRealloc()
to make it fit with your buffer variable. You didn't say what type it was, so I don't know what to cast it to - you'll need to do that. Hope this helps, Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
hello, I have a code that raise this error "Not enough storage is available to process this command." when I try to Realloc a buffer .... temp = (DWORD)GlobalReAlloc((HGLOBAL)eyeConClients[msg - SOCKET_ID - 1].buffer, szTemp, GMEM_MOVEABLE); this works ok many times ... and randomly raise that error .... any suggestions ? please help .... thanks !!!