Page 1 of 1

CreateBugReport problem?

Posted: Fri Jun 03, 2005 1:27 am
by jsantos98
Hello Madshi,

I'm trying to simply generate the report text, but I'm facing some problems:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var strBugReport : String;
begin
   try
      raise (Exception.Create('Test'));
   except on e : Exception do
      begin
        strBugReport :=  madExcept.CreateBugReport(false, e, ExceptAddr, GetCurrentThread(), Esp, Ebp, false);
        ShowMessage (strBugReport);

        HandleException();
      end;
   end;
end;
This generates a report like this :

Code: Select all

...
thread $fffffffe:
>> stack not accessible, exception location: 
0042b632 MainDemo.exe uMainDemoForm 301 TForm1.Button7Click'

main thread ($f64):
7c90eb94 ntdll.dll   KiFastSystemCallRet
7c90d9bf ntdll.dll   NtFindAtom
7c90eae0 ntdll.dll   KiUserCallbackDispatcher
77d4b8fe USER32.dll  SendMessageW
77d4e900 USER32.dll  CallWindowProcA
77d496c2 USER32.dll  DispatchMessageA'
However, the message shows something a little different :

Code: Select all

main thread ($578):
0042b62d MainDemo.exe uMainDemoForm 301 TForm1.Button7Click
7c90f0a5 ntdll.dll                      RtlAnsiStringToUnicodeString
7c90eae0 ntdll.dll                      KiUserCallbackDispatcher
77d4b8fe USER32.dll                     SendMessageW
77d4e900 USER32.dll                     CallWindowProcA
77d496c2 USER32.dll                     DispatchMessageA
0042baff MainDemo.exe MainDemo       52 initialization
How can I make the reports match? What am I doing wrong?


Best regards,

Joao Santos

Posted: Fri Jun 03, 2005 7:25 am
by madshi
You need to use GetCurrentThreadId instead of GetCurrentThread.

Posted: Fri Jun 03, 2005 11:54 am
by jsantos98
Ops... :oops:


Thanks for your help. :blush:

Joao