I want to create a class that uses the WINAPI AddVectoredExceptionHandler.
I googled a bit and everybody says to make it static since the WINAPI is purely C and doesnt know classes.
If I make it static I am not able to use a class member inside the static function.
After that I googled a bit on "how to call non-static method from static method of same class? c++"
But didnt found anything but for Callback WINAPI functions.
How can I use this WINAPI in a class? since it isnt a Callback function? (I also googled Callback function) (Doesnt seem to be one?)
class VEH
{
public:
VEH();
private:
void functionA(int a);
/*static*/ LONG ExceptionHandler(EXCEPTION_POINTERS* ExceptionInfo);
};
VEH::VEH()
{
AddVectoredExceptionHandler(2,(PVECTORED_EXCEPTION_HANDLER)ExceptionHandler); //INVALID TYPE CONVERSION (if non static)
}
void functionA(int a){
}
LONG ExceptionHandler(EXCEPTION_POINTERS* ExceptionInfo){
functionA(2); //a non-static member reference must be relative to a specific object (if static)
}