SetUnhandledExceptionFilter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • z00mit
    New Member
    • Nov 2008
    • 3

    SetUnhandledExceptionFilter

    Hi Guys,

    Have a question regarding the exception filter.

    I have a MiniDump class which looks like this:

    class MiniDumpHelper
    {
    public:

    MiniDumpHelper( )
    {
    ...
    }


    LONG WINAPI exitWithDump(st ruct _EXCEPTION_POIN TERS* exceptionInfo)
    {
    ...
    return EXCEPTION_CONTI NUE_SEARCH;
    }
    }

    then i have a host.cpp class where i have a main()
    I try this:

    MiniDump *miniDump = new MiniDump();
    SetUnhandledExc eptionFilter(mi niDump->exitWithDump );

    Then I get this:

    error C3867: 'MiniDump::exit WithDump': function call missing argument list;
    use '&MiniDump::exi tWithDump' to create a pointer to member

    So I do:

    MiniDump *miniDump = new MiniDump();
    SetUnhandledExc eptionFilter(&M iniDump::exitWi thDump);

    And I get this:

    'SetUnhandledEx ceptionFilter' : cannot convert parameter 1 from 'LONG (__stdcall :MiniDump::* )
    (_EXCEPTION_POI NTERS *)' to 'LPTOP_LEVEL_EX CEPTION_FILTER'



    I'm really stuck, would really appreciate help, thanks in advance!!

    z00mit
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    SetUnhandledExc eptionFilter is a C function, can can not pass a pointer to a class member function as a function pointer in this manor to a C function, or indeed any function that requires a pointer to a function as a parameter.

    exitWithDump will have either not be a member of the class or be a static member of the classed referenced through the class name rather than an object.

    Comment

    • z00mit
      New Member
      • Nov 2008
      • 3

      #3
      Hi banfa,

      Thanks so much for your help.
      What would you advise me to do in this case?

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Hard to say since I don't really know what you are doing or what the purpose of your helper class is meant to be but I would look at making exitWithDump a static member of your class and see if you can make it work that way.

        Comment

        Working...