I did HANDLE hHeap = GetProcessHeap(); which gives me the handle to the heap of the process then i did
DWORD dsize = 468178553;
(near pointer)PBYTE pBuffer = (LPBYTE)HeapAlloc(hHeap, 0, size);
but here i got pBuffer as NULL and then i did
_stprintf( (TCHAR*)pBuffer,"", , ,);
here my program crashes.............may be its bcoz the heap memory is less than
dsize(468178553)................how to solve this.........do i need to use a far pointer(LPBYTE).....plz help..
Jump to Post
> here my program crashes.............may be its bcoz the heap memory is less
yes. to specify a larger process default heap size for your executable image, use the
/HEAPlinker switch. http://msdn2.microsoft.com/en-us/library/f90ybzkh.aspx
to allocate 468 MB of memory, the heap is not …
Jump to Post
Curently allocated(4044MB)! if you are on a 32-bit machine, the address space is almost exhausted; you certinly won't get another 400 MB+ memory.
are you allocating this memory just once in your program?
if not are you freeing yhe allocated memory (VirtualFree with MEM_RELEASE) after use?
All 6 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.