Wintermute Engine > WME Lite

WME lite crash report support

(1/1)

HCDaniel:
Hi Mnemonic,

I want to use your crash report solution from WME for WME lite. I have not gotten very far yet, but I already see an issue that I fail to understand.

The extra code you use to catch the crashes:


--- Code: ---#ifndef _DEBUG
__try
{
#endif
if(!CBPlatform::Initialize(Game, hInstance, hPrevInstance, lpszCmdLine, nCmdShow))
return FALSE;
#ifndef _DEBUG
}
__except(CBPlatform::HandleCrashReport(Game, GetExceptionInformation()))
{
return FALSE;
}
#endif

--- End code ---

is not compiling just like that for me. If I leave the "Exception handling" settings as they are in WME (/EHsc) or with SEH (/EHa), I get an error about "__try/__except cannot be used because the enclosed code requires finalizers" (error line from my memory, I did not capture it properly). And obviously there will be another error (actually a warning, but I think a reasonable one) like "exceptions used but unwinding disabled" if I compile without exception handling - which I probably do not want in the first place.

My only alternative would be to look at this project

http://crashrpt.sourceforge.net/

but this looks like overhead to me, considering that there is already a crash reporting functionality in WME that just needs porting.

Can you give me a hint on this one?

Regards,

Daniel

Mnemonic:
From what I understand, the compiler complains about the main function creating the Game object.
I did a quick test and something like this compiles (not an actual code):

main ->
CAdGame* game = new AdGame;
CBPlaform::Run(Game);
delete Game;

platform ->
Platform::Run()
{
   __try
   {
      Platform::Initialize(Game);
      Platform::MessageLoop();
   }
   __except (Platform::HandleCrashReport())
   {

   }
}

So basically the idea is to move any object creation outside the function that contains __try.

HCDaniel:
Thanks a lot Mnemonic! I just tested it with your original crash report dll :) This is cool!

Navigation

[0] Message Index

Go to full version