Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, prompt please how i can create dump heap?
What functions should be used to receive the dump heap?
Posted

This is probably what you are looking for: MiniDumpWriteDump[^], good luck.

Please note that creating full memory dumps might take a longer time and it might create quite a large file, so handle with care.
 
Share this answer
 
v2
I try.. but nothing is written to the file
C++
case IDC_BUTTON2:
hFile = CreateFile( TEXT("minidump.dmp"), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
	
  if( hFile!=NULL &&  hFile!=INVALID_HANDLE_VALUE )
  {

  MINIDUMP_EXCEPTION_INFORMATION eInfo;
  eInfo.ThreadId = GetCurrentThreadId();
  eInfo.ExceptionPointers = NULL;
  eInfo.ClientPointers = FALSE;

  MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), hFile, 
	  MiniDumpNormal, &eInfo, NULL, NULL);
 
MessageBox(hDlg,L"MiniDumpCreate",L"Minidump",MB_OK);

CloseHandle( hFile ); } 
 
Share this answer
 
Comments
Code-o-mat 13-May-14 12:03pm    
First, if you want to send a comment for a solution, use the button under it labeled "Have a Question or Comment?", don't send it as another solution.

Second, you can check the last error code (e.g. by using GetLastError()) to see what might have went wrong.

Third, if you are not after exception information, then just specify NULL where you now specified &eInfo.

Fourth, if you want the heap included in your dump, try using MiniDumpWithFullMemory instead of MiniDumpNormal.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900