Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: WME lite crash report support  (Read 8919 times)

0 Members and 1 Guest are viewing this topic.

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile
WME lite crash report support
« on: March 03, 2016, 09:08:38 AM »

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: [Select]
#ifndef _DEBUG
__try
{
#endif
if(!CBPlatform::Initialize(Game, hInstance, hPrevInstance, lpszCmdLine, nCmdShow))
return FALSE;
#ifndef _DEBUG
}
__except(CBPlatform::HandleCrashReport(Game, GetExceptionInformation()))
{
return FALSE;
}
#endif

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
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: WME lite crash report support
« Reply #1 on: March 03, 2016, 09:02:53 PM »

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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile
Re: WME lite crash report support
« Reply #2 on: March 04, 2016, 07:59:49 AM »

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

Page created in 0.036 seconds with 19 queries.